[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH] cr-daily-branch, cr-publish-flight-logs: Tolerate failure to push harness



Provide cr-publish-flight-logs --push-harness-try, which attempts the
push but doesn't mind if it fails.

If we are not --real, tolerate failure to publish the flight logs.

Also, honour OSSTEST_PUSH_HARNESS which might contain '' or
--push-harness or --push-harness-try.

CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 cr-publish-flight-logs | 10 ++++++++--
 cri-args-hostlists     |  5 ++++-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/cr-publish-flight-logs b/cr-publish-flight-logs
index 45545ce..1e5a49d 100755
--- a/cr-publish-flight-logs
+++ b/cr-publish-flight-logs
@@ -27,9 +27,9 @@ our %c;
 readglobalconfig();
 
 my $push_harness = 0;
-if (@ARGV && $ARGV[0] eq '--push-harness') {
+if (@ARGV && $ARGV[0] =~ m{^--push-harness(?:-try)?$}) {
+    $push_harness = $&;
     shift @ARGV;
-    $push_harness = 1;
 }
 
 my $flight= shift @ARGV // '';
@@ -46,8 +46,14 @@ if ($push_harness) {
 
     exit 0 if (!$githost || !$gitdir);
 
+    eval {
     system_checked("git push $githost:$gitdir HEAD:refs/heads/flight-$flight");
     system_checked("ssh $githost 'cd $gitdir && git update-server-info'");
+    };
+    if ($@) {
+       $push_harness eq '--push-harness-try' or die;
+       warn;
+    }
 }
 
 sub copydir ($$) {
diff --git a/cri-args-hostlists b/cri-args-hostlists
index a75ff7b..7d23087 100644
--- a/cri-args-hostlists
+++ b/cri-args-hostlists
@@ -51,6 +51,8 @@ elif [ "x$1" = "x--like-real" ]; then
        : ${OSSTEST_CRON_SETTINGS:=$dcs-real}
        : ${OSSTEST_HTML_SUFFIX:=-play}
        shift
+else
+       : ${OSSTEST_PUSH_HARNESS=--push-harness-try}
 fi     
 : ${OSSTEST_BLESSING:=play}
 
@@ -127,7 +129,8 @@ start_email () {
 publish_send_email () {
        local flight=$1
        exec >&2
-       ./cr-publish-flight-logs --push-harness $flight
+       ./cr-publish-flight-logs ${OSSTEST_PUSH_HARNESS- --push-harness} \
+           $flight
        send_email tmp/$flight.email
 }
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.