diff options
| author | ivan <ivan> | 2012-02-12 01:22:44 +0000 |
|---|---|---|
| committer | ivan <ivan> | 2012-02-12 01:22:44 +0000 |
| commit | f67444281c6ca08af1463a987684d9223044f60a (patch) | |
| tree | 31b5e40f39a005a682cf45c1317a5caafcc075d2 | |
| parent | 9e013fca2dc7cbb43d71f3d3ca6ec8236fb680f5 (diff) | |
apply shellcommands ignored_errors regexen to STDOUT as well as STDERR, RT#15347
| -rw-r--r-- | FS/FS/part_export/shellcommands.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm index 59146306d..edbe78f03 100644 --- 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; - 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 ) { + $output =~ s/$ignored_error//g; $errput =~ s/$ignored_error//g; } + chomp($output); chomp($errput); } + die $errput if $errput; die $output if $output; ''; |
