Merge pull request #1763 from coolo/restart_on_failure
Fail rabbit-openqa and have systemd restart it
This commit is contained in:
commit
1f8bf215ec
@ -32,6 +32,7 @@ class Project(object):
|
|||||||
self.api = StagingAPI(apiurl, name)
|
self.api = StagingAPI(apiurl, name)
|
||||||
self.staging_projects = dict()
|
self.staging_projects = dict()
|
||||||
self.listener = None
|
self.listener = None
|
||||||
|
self.logger = logging.getLogger(__name__)
|
||||||
self.replace_string = self.api.attribute_value_load('OpenQAMapping')
|
self.replace_string = self.api.attribute_value_load('OpenQAMapping')
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
@ -104,7 +105,7 @@ class Project(object):
|
|||||||
taken_names[name] = id
|
taken_names[name] = id
|
||||||
|
|
||||||
for info in openqa_infos.values():
|
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:
|
try:
|
||||||
http_POST(url, data=xml)
|
http_POST(url, data=xml)
|
||||||
except HTTPError:
|
except HTTPError:
|
||||||
@ -262,11 +263,8 @@ if __name__ == '__main__':
|
|||||||
for entry in root.findall('project'):
|
for entry in root.findall('project'):
|
||||||
l.add(Project(entry.get('name')))
|
l.add(Project(entry.get('name')))
|
||||||
|
|
||||||
while True:
|
try:
|
||||||
try:
|
l.run()
|
||||||
l.run()
|
except KeyboardInterrupt:
|
||||||
except KeyboardInterrupt:
|
l.stop()
|
||||||
l.stop()
|
|
||||||
except (HTTPError, URLError, ConnectionError, SSLError):
|
|
||||||
# OBS/openQA hickup
|
|
||||||
sleep(10)
|
|
||||||
|
@ -4,6 +4,7 @@ Description=openSUSE Release Tools: Sync openQA status
|
|||||||
[Service]
|
[Service]
|
||||||
User=osrt-rabbit-openqa
|
User=osrt-rabbit-openqa
|
||||||
ExecStart=/usr/bin/osrt-rabbit-openqa
|
ExecStart=/usr/bin/osrt-rabbit-openqa
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
Loading…
x
Reference in New Issue
Block a user