From 344bdf1faf1fb978e9abaad790bc4dbe763a4cbf Mon Sep 17 00:00:00 2001 From: K Jonathan Harker Date: Fri, 19 Jun 2015 13:37:03 -0700 Subject: [PATCH] Fix logic error in gate-project-config-projects-yaml Previously labels were only being checked for validity if an upstream was given due to a premature 'continue' if no upstream is given before checking labels. Change-Id: I7dd564d59a30ca14bbad4044a985ba08fbe55ca5 --- tools/check_valid_gerrit_projects.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tools/check_valid_gerrit_projects.py b/tools/check_valid_gerrit_projects.py index 343fe6b600..b1754f8813 100755 --- a/tools/check_valid_gerrit_projects.py +++ b/tools/check_valid_gerrit_projects.py @@ -60,16 +60,15 @@ for p in projects: # Allow git:// and https:// URLs for importing upstream repositories, # but not git@ upstream = p.get('upstream') - if not upstream: - continue - for prefix in VALID_SCHEMES: - if upstream.startswith(prefix): - break - else: - found_errors += 1 - print('Error: Upstream URLs should use a scheme in %s, ' - 'found %s in %s' % - (VALID_SCHEMES, p['upstream'], name)) + if upstream: + for prefix in VALID_SCHEMES: + if upstream.startswith(prefix): + break + else: + found_errors += 1 + print('Error: Upstream URLs should use a scheme in %s, ' + 'found %s in %s' % + (VALID_SCHEMES, p['upstream'], name)) # Check for any wrong entries for entry in p: for label in VALID_LABELS: