[freeside-commits] freeside/FS/FS/part_export shellcommands.pm, 1.61, 1.62 shellcommands_withdomain.pm, 1.13, 1.14
Mark Wells
mark at wavetail.420.am
Tue Dec 13 13:15:50 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail.420.am:/tmp/cvs-serv2193/FS/FS/part_export
Modified Files:
shellcommands.pm shellcommands_withdomain.pm
Log Message:
option for shellcommands to ignore errors, #15357
Index: shellcommands.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/shellcommands.pm,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -w -d -r1.61 -r1.62
--- shellcommands.pm 6 Oct 2011 05:51:00 -0000 1.61
+++ shellcommands.pm 13 Dec 2011 21:15:48 -0000 1.62
@@ -80,7 +80,11 @@
'Radius group mapping to reason (via template user)',
type => 'textarea',
},
- 'ignored_errors' => { label => 'Regexes of errors to ignore, separated by newlines',
+ 'ignore_all_output' => {
+ label => 'Ignore all output and errors from the command',
+ type => 'checkbox',
+ },
+ 'ignored_errors' => { label => 'Regexes of specific errors to ignore, separated by newlines',
type => 'textarea'
},
# 'no_queue' => { label => 'Run command immediately',
@@ -354,6 +358,7 @@
host => $self->machine,
command => $command_string,
stdin_string => $stdin_string,
+ ignore_all_output => $self->option('ignore_all_output'),
ignored_errors => $self->option('ignored_errors') || '',
);
@@ -447,6 +452,7 @@
host => $self->machine,
command => $command_string,
stdin_string => $stdin_string,
+ ignore_all_output => $self->option('ignore_all_output'),
ignored_errors => $self->option('ignored_errors') || '',
);
@@ -480,12 +486,14 @@
$opt->{'user'}.'@'.$opt->{'host'},
'default_stdin_fh' => $def_in
);
+ # ignore_all_output doesn't override this
die "Couldn't establish SSH connection: ". $ssh->error if $ssh->error;
my $ssh_opt = {};
$ssh_opt->{'stdin_data'} = $opt->{'stdin_string'}
if exists($opt->{'stdin_string'}) and length($opt->{'stdin_string'});
my ($output, $errput) = $ssh->capture2($ssh_opt, $opt->{'command'});
+ return if $opt->{'ignore_all_output'};
die "Error running SSH command: ". $ssh->error if $ssh->error;
if ($errput && $opt->{'ignored_errors'} && length($opt->{'ignored_errors'})) {
Index: shellcommands_withdomain.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/shellcommands_withdomain.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -d -r1.13 -r1.14
--- shellcommands_withdomain.pm 5 Mar 2010 18:24:56 -0000 1.13
+++ shellcommands_withdomain.pm 13 Dec 2011 21:15:48 -0000 1.14
@@ -66,6 +66,10 @@
type=>'select', options=>[qw(crypt md5)],
default => 'crypt',
},
+ 'ignore_all_output' => {
+ label => 'Ignore all output and errors from the command',
+ type => 'checkbox',
+ },
;
%info = (
More information about the freeside-commits
mailing list