Merge pull request #2388 from coolo/sync_earlier

Notify the obs_rsync plugin already when the scheduler is finished
This commit is contained in:
Stephan Kulow 2020-01-28 13:06:55 +01:00 committed by GitHub
commit 8bd11b0060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -209,6 +209,8 @@ class Listener(PubSubConsumer):
def on_published_repo(self, payload): def on_published_repo(self, payload):
for p in self.projects: for p in self.projects:
p.check_published_repo(str(payload['project']), str(payload['repo']), str(payload['buildid'])) p.check_published_repo(str(payload['project']), str(payload['repo']), str(payload['buildid']))
def on_finished_repo(self, payload):
# notify openQA to sync the projects - the plugin will check itself it # notify openQA to sync the projects - the plugin will check itself it
# the project is to be synced. For now we notify about every 'images' repo # the project is to be synced. For now we notify about every 'images' repo
if payload['repo'] == 'images': if payload['repo'] == 'images':
@ -226,6 +228,8 @@ class Listener(PubSubConsumer):
self.acknowledge_message(method.delivery_tag) self.acknowledge_message(method.delivery_tag)
if method.routing_key == '{}.obs.repo.published'.format(amqp_prefix): if method.routing_key == '{}.obs.repo.published'.format(amqp_prefix):
self.on_published_repo(json.loads(body)) self.on_published_repo(json.loads(body))
elif method.routing_key == '{}.obs.repo.build_finished'.format(amqp_prefix):
self.on_finished_repo(json.loads(body))
elif re.search(r'.openqa.', method.routing_key): elif re.search(r'.openqa.', method.routing_key):
self.on_openqa_job(json.loads(body).get('ISO')) self.on_openqa_job(json.loads(body).get('ISO'))
else: else: