Merge pull request #2134 from coolo/put_openqa

rabbit-openqa: Catch exceptions as PUT to openqa might result in 404
This commit is contained in:
Stephan Kulow 2019-07-22 09:48:05 +02:00 committed by GitHub
commit 35dabf52dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,7 @@ from osclib.conf import Config
from osclib.stagingapi import StagingAPI
from lxml import etree as ET
from openqa_client.client import OpenQA_Client
from openqa_client.exceptions import ConnectionError
from openqa_client.exceptions import ConnectionError, RequestError
from urllib.error import HTTPError, URLError
from urllib.parse import quote_plus
@ -209,7 +209,10 @@ class Listener(PubSubConsumer):
# 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
if payload['repo'] == 'images':
self.openqa.openqa_request('PUT', 'obs_rsync', str(payload['project']), 'runs')
try:
self.openqa.openqa_request('PUT', 'obs_rsync/{}/runs'.format(payload['project']), retries=0)
except RequestError as e:
self.logger.info("Got exception on syncing repository: {}".format(e))
def on_openqa_job(self, iso):
self.logger.debug('openqa_job_change %s', iso)