projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
860445e
)
apply shellcommands ignored_errors regexen to STDOUT as well as STDERR, RT#15347
author
ivan
<ivan>
Sun, 12 Feb 2012 01:22:47 +0000
(
01:22
+0000)
committer
ivan
<ivan>
Sun, 12 Feb 2012 01:22:47 +0000
(
01:22
+0000)
FS/FS/part_export/shellcommands.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_export/shellcommands.pm
b/FS/FS/part_export/shellcommands.pm
index
5914630
..
edbe78f
100644
(file)
--- a/
FS/FS/part_export/shellcommands.pm
+++ b/
FS/FS/part_export/shellcommands.pm
@@
-498,13
+498,18
@@
sub ssh_cmd { #subroutine, not method
return if $opt->{'ignore_all_output'};
die "Error running SSH command: ". $ssh->error if $ssh->error;
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'})) {
+ if ( ($output || $errput)
+ && $opt->{'ignored_errors'} && length($opt->{'ignored_errors'})
+ ) {
my @ignored_errors = split('\n',$opt->{'ignored_errors'});
foreach my $ignored_error ( @ignored_errors ) {
my @ignored_errors = split('\n',$opt->{'ignored_errors'});
foreach my $ignored_error ( @ignored_errors ) {
+ $output =~ s/$ignored_error//g;
$errput =~ s/$ignored_error//g;
}
$errput =~ s/$ignored_error//g;
}
+ chomp($output);
chomp($errput);
}
chomp($errput);
}
+
die $errput if $errput;
die $output if $output;
'';
die $errput if $errput;
die $output if $output;
'';