summaryrefslogtreecommitdiff
path: root/rhautoimport-oi
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-03-17 15:45:23 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-03-17 15:45:23 (GMT)
commit43613383b248e4c6d8ccfdac98ec114f127290d7 (patch)
tree2df9122fbd4732f3588288d6ad6bcb5e18798d13 /rhautoimport-oi
parentc37171a835f9a6abf45c8fef5f1564ed02e4d611 (diff)
(re)added binmode(utf8)
added special return code wich means success with errors
Diffstat (limited to 'rhautoimport-oi')
-rwxr-xr-xrhautoimport-oi14
1 files changed, 12 insertions, 2 deletions
diff --git a/rhautoimport-oi b/rhautoimport-oi
index 987a700..71039f6 100755
--- a/rhautoimport-oi
+++ b/rhautoimport-oi
@@ -41,6 +41,10 @@ my $RD_GROUP = "ondainfo";
my $PV_ID = '220';
my $LAST_RUN = 0;
+binmode(STDIN, ":utf8");
+binmode(STDOUT, ":utf8");
+binmode(STDERR, ":utf8");
+
my $curweek = RHRD::utils::get_rd_week();
if($curweek == 1 || $curweek == 3) {
print "please don't run this script in week 1 or 3!\n";
@@ -143,7 +147,13 @@ 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);
@@ -155,4 +165,4 @@ open($fhs, '>', $LAST_FILE);
print $fhs "$broadcast_num";
close($fhs);
-exit 0;
+exit $exit_code;