Make wait-for-signed-ostree repeat the fedmsg in case the signer crashed
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
parent
905064775a
commit
8f3c06bd14
@ -5,6 +5,7 @@ from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import fedmsg.config
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
@ -29,9 +30,21 @@ if __name__ == '__main__':
|
||||
commit = data['commitid']
|
||||
path = '%s/objects/%s/%s.commitmeta' % (repo, commit[:2], commit[2:])
|
||||
|
||||
config = fedmsg.config.load_config()
|
||||
config['active'] = True # Connect out to a fedmsg-relay instance
|
||||
config['cert_prefix'] = 'releng' # Use this cert.
|
||||
fedmsg.init(**config)
|
||||
topic = 'compose.%s' % opts.cmd.replace('-', '.').lower()
|
||||
|
||||
count = 0
|
||||
while not os.path.exists(path):
|
||||
print('%s: Commit not signed yet, waiting...'
|
||||
% datetime.datetime.utcnow())
|
||||
count += 1
|
||||
if count >= 60: # Repeat every 5 minutes
|
||||
print('Repeating notification')
|
||||
fedmsg.publish(topic=topic, modname='pungi', msg=data)
|
||||
count = 0
|
||||
time.sleep(5)
|
||||
|
||||
print('Found signature.')
|
||||
|
Loading…
Reference in New Issue
Block a user