X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Ftransitions.py;h=374beabbb9967a24a36a9616f474977c47b9dece;hb=b07852aa10727e959844a3f3b4d5b8a6bce00dbf;hp=5636624f716a4e8a4d755d4a352e690e22713751;hpb=06b17e68fd4a76e7a12f741f26654e55bff05c79;p=dak.git diff --git a/dak/transitions.py b/dak/transitions.py index 5636624f..374beabb 100644 --- a/dak/transitions.py +++ b/dak/transitions.py @@ -183,9 +183,9 @@ def load_transitions(trans_file): ##################################### #### This may run within sudo !! #### ##################################### -def lock_file(file): +def lock_file(f): for retry in range(10): - lock_fd = os.open(file, os.O_RDWR | os.O_CREAT) + lock_fd = os.open(f, os.O_RDWR | os.O_CREAT) try: fcntl.lockf(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB) return lock_fd @@ -197,7 +197,7 @@ def lock_file(file): else: raise - daklib.utils.fubar("Couldn't obtain lock for %s." % (lockfile)) + daklib.utils.fubar("Couldn't obtain lock for %s." % (f)) ################################################################################