From 0fbd5ca822d35a33575007ce63f18f2f8c4cf50d Mon Sep 17 00:00:00 2001
From: Clark Boylan <clark.boylan@gmail.com>
Date: Thu, 18 Sep 2014 17:29:55 -0700
Subject: [PATCH] Don't let a reqs sync fail kill the sync job

Try to sync each and every project. An error syncing a single project
should not cause the job to stop running early preventing syncage for
projects later in the list. Do this by setting the success flag
appropriately if syncing fails and continuing to the next project.

Change-Id: I801abca1f21643fc23a8e3b5e7fc6d89ebd313ff
---
 .../files/slave_scripts/propose_update.sh                | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/openstack_project/files/slave_scripts/propose_update.sh b/modules/openstack_project/files/slave_scripts/propose_update.sh
index aa5c938c48..c8ff6a7faf 100755
--- a/modules/openstack_project/files/slave_scripts/propose_update.sh
+++ b/modules/openstack_project/files/slave_scripts/propose_update.sh
@@ -90,11 +90,20 @@ EOF
             continue
         fi
 
+        # Don't short circuit when one project fails to sync.
+        set +e
         if [ "$OWN_PROJECT" == "requirements" ] ; then
             python update.py $PROJECT_DIR
         else
             bash -xe tools/sync-projects.sh $PROJECT_DIR
         fi
+        RET=$?
+        set -e
+        if [ "$RET" -ne "0" ] ; then
+            ALL_SUCCESS=1
+            echo "Error in syncing: Ignoring $PROJECT"
+            continue
+        fi
 
         pushd $PROJECT_DIR
         if ! git diff --stat --exit-code HEAD ; then