Skip to content

Commit

Permalink
gocd/rabbit-openqa.py: Ignore projects without a staging setup
Browse files Browse the repository at this point in the history
Catch a 404 HTTPError and print an error instead of terminating.
  • Loading branch information
Vogtinator committed Jun 29, 2023
1 parent 8b1c308 commit 18009e5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions gocd/rabbit-openqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,18 @@ def start_consuming(self):
# initial state
self.projects_to_check = set()
for project in self.projects:
self.logger.info('Fetching ISOs of %s', project.name)
for sproj in project.init():
self.projects_to_check.add((project, sproj))
try:
self.logger.info('Fetching ISOs of %s', project.name)
for sproj in project.init():
self.projects_to_check.add((project, sproj))
except HTTPError as e:
if e.code == 404:
# No staging workflow? Have to protect against "rogue" projects
self.logger.error('Failed to load staging projects')
continue
else:
raise

self.logger.info('Finished fetching initial ISOs, listening')
super(Listener, self).start_consuming()

Expand Down

0 comments on commit 18009e5

Please sign in to comment.