Merge pull request #1763 from coolo/restart_on_failure

Fail rabbit-openqa and have systemd restart it
This commit is contained in:
Stephan Kulow 2018-11-05 12:49:21 +01:00 committed by GitHub
commit 1f8bf215ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View File

@ -32,6 +32,7 @@ class Project(object):
self.api = StagingAPI(apiurl, name)
self.staging_projects = dict()
self.listener = None
self.logger = logging.getLogger(__name__)
self.replace_string = self.api.attribute_value_load('OpenQAMapping')
def init(self):
@ -104,7 +105,7 @@ class Project(object):
taken_names[name] = id
for info in openqa_infos.values():
xml = self.openqa_check_xml(info['url'], info['state'], info['name'])
xml = self.openqa_check_xml(info['url'], info['state'], 'openqa:' + info['name'])
try:
http_POST(url, data=xml)
except HTTPError:
@ -262,11 +263,8 @@ if __name__ == '__main__':
for entry in root.findall('project'):
l.add(Project(entry.get('name')))
while True:
try:
l.run()
except KeyboardInterrupt:
l.stop()
except (HTTPError, URLError, ConnectionError, SSLError):
# OBS/openQA hickup
sleep(10)

View File

@ -4,6 +4,7 @@ Description=openSUSE Release Tools: Sync openQA status
[Service]
User=osrt-rabbit-openqa
ExecStart=/usr/bin/osrt-rabbit-openqa
Restart=on-failure
[Install]
WantedBy=multi-user.target