afs-release: better info when can not get lockfile

For some reason this is failing in the gate -- the some reason bit is
hard to determine at the moment.  Log the exception.

Change-Id: I13c60c5dfc4ab19d8dec589c96338adc7461c992
This commit is contained in:
Ian Wienand 2022-09-16 15:26:16 +10:00
parent 66e510f0ee
commit 14b85ea1b8
No known key found for this signature in database
2 changed files with 3 additions and 2 deletions

View File

@ -125,8 +125,8 @@ def get_lock(path):
with open(path, 'w') as f:
try:
fcntl.flock(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError:
print("Unable to get lockfile!")
except IOError as e:
print("Unable to get lockfile: %s" % e)
sys.exit(1)
f.write("%s\n" % os.getpid())
f.flush()

View File

@ -486,6 +486,7 @@
- roles/
- playbooks/roles/mirror-update/
- playbooks/roles/reprepro/
- playbooks/roles/afs-release/
- playbooks/service-mirror-update.yaml
- playbooks/zuul/templates/host_vars/mirror-update99.opendev.org.yaml.j2
- testinfra/test_mirror-update.py