diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2006-12-22 11:54:52 -0500 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-12-22 11:54:52 -0500 |
commit | e251b5b49ef9b4477964ad2ece515f0f8248823a (patch) | |
tree | 16b45c4b2a543d58199515c13cae0be3e0ebe4e9 /cobbler | |
parent | 190687f2166d00692ac7a4abbefe4e26db7b0ffc (diff) | |
download | third_party-cobbler-e251b5b49ef9b4477964ad2ece515f0f8248823a.tar.gz third_party-cobbler-e251b5b49ef9b4477964ad2ece515f0f8248823a.tar.xz third_party-cobbler-e251b5b49ef9b4477964ad2ece515f0f8248823a.zip |
Fix bug in locking mechanism.
Diffstat (limited to 'cobbler')
-rwxr-xr-x | cobbler/cobbler.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cobbler/cobbler.py b/cobbler/cobbler.py index 1197bb4..f2e813e 100755 --- a/cobbler/cobbler.py +++ b/cobbler/cobbler.py @@ -463,9 +463,11 @@ def main(): CLI entry point """ exitcode = 0 + lock_hit = False try: if LOCKING_ENABLED: if os.path.exists(LOCKFILE): + lock_hit = True raise cexceptions.CobblerException("lock") try: lockfile = open(LOCKFILE,"w+") @@ -476,7 +478,7 @@ def main(): except cexceptions.CobblerException, exc: print str(exc)[1:-1] # remove framing air quotes exitcode = 1 - if LOCKING_ENABLED: + if LOCKING_ENABLED and not lock_hit: try: os.remove(LOCKFILE) except: |