Raise an error if acl pushes fail

Previously it was possible for an acl push to fail then we would record
successful acl push via our project cache's sha entry for that acl file.
The reason for this is despite success or failure of the acl push we
continue on without "problems". Unfortunately this can lead to projects
failing to update without any indication this has happened.

Update jeepyb to raise an exception if there is a failure pushing. THis
should prevent the project cache file from being updated and will cause
manage-projects to try again later. The downside to this is we will
short circuit our project handling if there are many updates to perform.
THis seems preferable to silently "succeeding".

Note that we special case read only projects by detecting the error
pushing an acl to a read only project and treating this as success. This
will allow us to delete our cache file and update everythin while
passing over read only projects as is.

Change-Id: I0d1c1160f2a28fc023fd71c8010ddcf6555efa14
diff --git a/jeepyb/cmd/manage_projects.py b/jeepyb/cmd/manage_projects.py
index 212d899..1a93709 100644
--- a/jeepyb/cmd/manage_projects.py
+++ b/jeepyb/cmd/manage_projects.py
@@ -179,7 +179,13 @@
     if status != 0:
         log.error("Failed to push config for project: %s" % project)
         log.error(out)
-        return False
+        if 'project state does not permit write' in out:
+            # We tried to push an acl update to a read only project.
+            # This is an error to Gerrit, but we treat it as success
+            # to allow other acls to update.
+            return True
+        else:
+            return False
     return True
 
 
@@ -377,8 +383,10 @@
             # nothing was copied, so we're done
             return
         create_groups_file(project, gerrit, repo_path)
-        push_acl_config(project, remote_url, repo_path,
-                        GERRIT_GITID, ssh_env)
+        rc = push_acl_config(project, remote_url, repo_path,
+                             GERRIT_GITID, ssh_env)
+        if not rc:
+            raise Exception("Non zero acl push return value.")
     except Exception:
         log.exception(
             "Exception processing ACLS for %s." % project)