diff options
Diffstat (limited to 'rhautoimport-nw')
-rwxr-xr-x | rhautoimport-nw | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/rhautoimport-nw b/rhautoimport-nw index d2168f2..302b572 100755 --- a/rhautoimport-nw +++ b/rhautoimport-nw @@ -40,6 +40,10 @@ my $RD_GROUP = "netwatcher"; my $PV_ID = '73'; my $LAST_RUN = 0; +binmode(STDIN, ":utf8"); +binmode(STDOUT, ":utf8"); +binmode(STDERR, ":utf8"); + if($#ARGV >= 0 && $ARGV[0] eq 'last') { print "!!!This is the last attempt, there won't be a retry on error!!!\n"; $LAST_RUN = 1; @@ -150,11 +154,17 @@ if($ret) { print "\nImport Success:\n\n"; print $log; print "\n"; -rhautoimport::pv_add_note($sum_title, $sum_text, $PV_ID, $id, "1"); +my $exit_code = 0; +($ret, $log) = rhautoimport::pv_add_note($sum_title, $sum_text, $PV_ID, $id, "1"); +print $log; +if($ret) { + print "\nIgnoring failed note import - manual intervention necessary!\n"; + $exit_code = 23; +} unlink($STAT_FILE); open(my $fhs, '>', $STAT_FILE); print $fhs "$file"; close($fhs); -exit 0; +exit $exit_code; |