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:
parent
f0417181ee
commit
fc5a02530d
3 changed files with 12 additions and 4 deletions
|
@ -170,6 +170,7 @@ def sync_ostree(dst, ref):
|
||||||
if src_commit == dst_commit:
|
if src_commit == dst_commit:
|
||||||
logger.info('OSTree at %s, ref %s in sync', dst, ref)
|
logger.info('OSTree at %s, ref %s in sync', dst, ref)
|
||||||
else:
|
else:
|
||||||
|
print('Syncing ostree ref %s -> %s' % (ref, src_commit, dst_commit))
|
||||||
logger.info('Syncing OSTree to %s, ref %s: %s -> %s',
|
logger.info('Syncing OSTree to %s, ref %s: %s -> %s',
|
||||||
dst, ref, src_commit, dst_commit)
|
dst, ref, src_commit, dst_commit)
|
||||||
cmd = ['ostree', 'pull-local', '--verbose', '--repo',
|
cmd = ['ostree', 'pull-local', '--verbose', '--repo',
|
||||||
|
@ -177,6 +178,7 @@ def sync_ostree(dst, ref):
|
||||||
out = run_command(cmd)
|
out = run_command(cmd)
|
||||||
cmd = ['ostree', 'summary', '--verbose', '--repo', dst, '--update']
|
cmd = ['ostree', 'summary', '--verbose', '--repo', dst, '--update']
|
||||||
run_command(cmd)
|
run_command(cmd)
|
||||||
|
print('Ostree ref %s now at %s' % (ref, dst_commit))
|
||||||
|
|
||||||
|
|
||||||
def update_fullfilelist(modules):
|
def update_fullfilelist(modules):
|
||||||
|
@ -324,10 +326,15 @@ def sync_single_release(release):
|
||||||
if curstate and curstate == target:
|
if curstate and curstate == target:
|
||||||
logger.info('This repo has already been synced')
|
logger.info('This repo has already been synced')
|
||||||
else:
|
else:
|
||||||
|
print('Syncing %s %s from %s -> %s' % (release,
|
||||||
|
repo,
|
||||||
|
curstate,
|
||||||
|
target))
|
||||||
sync_single_repo(release, repo)
|
sync_single_repo(release, repo)
|
||||||
with open(curstatefile, 'w') as f:
|
with open(curstatefile, 'w') as f:
|
||||||
f.write(target)
|
f.write(target)
|
||||||
needssync = True
|
needssync = True
|
||||||
|
print('Synced %s %s to %s' % (release, repo, target))
|
||||||
|
|
||||||
for ostree in RELEASES[release]['repos'][repo].get('ostrees', []):
|
for ostree in RELEASES[release]['repos'][repo].get('ostrees', []):
|
||||||
pairs = []
|
pairs = []
|
||||||
|
|
3
roles/bodhi2/backend/files/new-updates-sync.cron
Normal file
3
roles/bodhi2/backend/files/new-updates-sync.cron
Normal 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'
|
||||||
|
|
|
@ -268,10 +268,8 @@
|
||||||
- bodhi
|
- bodhi
|
||||||
- cron
|
- cron
|
||||||
|
|
||||||
- name: Updates sync cron job.
|
- name: Set the updates sync cron job
|
||||||
cron: name="updates-sync" minute="*/5" user="ftpsync"
|
copy: src=new-updates-sync.cron dest=/etc/cron.d/updates-sync
|
||||||
job="/usr/local/bin/lock-wrapper updates-push '/usr/local/bin/new-updates-sync'"
|
|
||||||
cron_file=updates-sync
|
|
||||||
when: inventory_hostname.startswith('bodhi-backend01') and env == "production"
|
when: inventory_hostname.startswith('bodhi-backend01') and env == "production"
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue