Make new-updates-sync always print status and email to releng-cron

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2018-04-25 21:53:17 +02:00
parent f0417181ee
commit fc5a02530d
3 changed files with 12 additions and 4 deletions

View file

@ -170,6 +170,7 @@ def sync_ostree(dst, ref):
if src_commit == dst_commit:
logger.info('OSTree at %s, ref %s in sync', dst, ref)
else:
print('Syncing ostree ref %s -> %s' % (ref, src_commit, dst_commit))
logger.info('Syncing OSTree to %s, ref %s: %s -> %s',
dst, ref, src_commit, dst_commit)
cmd = ['ostree', 'pull-local', '--verbose', '--repo',
@ -177,6 +178,7 @@ def sync_ostree(dst, ref):
out = run_command(cmd)
cmd = ['ostree', 'summary', '--verbose', '--repo', dst, '--update']
run_command(cmd)
print('Ostree ref %s now at %s' % (ref, dst_commit))
def update_fullfilelist(modules):
@ -324,10 +326,15 @@ def sync_single_release(release):
if curstate and curstate == target:
logger.info('This repo has already been synced')
else:
print('Syncing %s %s from %s -> %s' % (release,
repo,
curstate,
target))
sync_single_repo(release, repo)
with open(curstatefile, 'w') as f:
f.write(target)
needssync = True
print('Synced %s %s to %s' % (release, repo, target))
for ostree in RELEASES[release]['repos'][repo].get('ostrees', []):
pairs = []

View file

@ -0,0 +1,3 @@
MAILTO=releng-cron@lists.fedoraproject.org
*/5 * * * * ftpsync /usr/local/bin/lock-wrapper updates-push '/usr/local/bin/new-updates-sync'

View file

@ -268,10 +268,8 @@
- bodhi
- cron
- name: Updates sync cron job.
cron: name="updates-sync" minute="*/5" user="ftpsync"
job="/usr/local/bin/lock-wrapper updates-push '/usr/local/bin/new-updates-sync'"
cron_file=updates-sync
- name: Set the updates sync cron job
copy: src=new-updates-sync.cron dest=/etc/cron.d/updates-sync
when: inventory_hostname.startswith('bodhi-backend01') and env == "production"
tags:
- config