Fix flow control when updating remotes
Manage projects would break out of its retry loop to do git remote
updates when errors occurred and not break out of the loop when it
successfully ran commands. This logic is inverted. We want to retry
failures and stop when we succeed. Fix the logic by inverting it.
Change-Id: I75eb7e4134db618c688243c77c379c12c9468f7b
diff --git a/jeepyb/cmd/manage_projects.py b/jeepyb/cmd/manage_projects.py
index 9ebca86..96090a1 100644
--- a/jeepyb/cmd/manage_projects.py
+++ b/jeepyb/cmd/manage_projects.py
@@ -139,7 +139,8 @@
status = git_command(repo_path, "remote update --prune", env)
if status != 0:
log.error("Failed to update remote: %s" % remote_url)
- break
+ time.sleep(2)
+ continue
else:
status, output = git_command_output(
repo_path, "ls-files --with-tree=remotes/gerrit-meta/config "
@@ -148,6 +149,8 @@
log.debug("Failed to find project.config for project: %s" %
project)
time.sleep(2)
+ else:
+ break
if output.strip() != "project.config" or status != 0:
log.error("Failed to find project.config for project: %s" % project)
raise FetchConfigException()