mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[fix] Microdecision : do not miserably crash if the lock does not exist when attempting to release it
This commit is contained in:
parent
06646931b1
commit
0e16546af9
1 changed files with 4 additions and 1 deletions
|
@ -497,7 +497,10 @@ class MoulinetteLock(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if self._locked:
|
if self._locked:
|
||||||
os.unlink(self._lockfile)
|
if os.path.exists(self._lockfile):
|
||||||
|
os.unlink(self._lockfile)
|
||||||
|
else:
|
||||||
|
logger.warning("Uhoh, somehow the lock %s did not exist ..." % self._lockfile)
|
||||||
logger.debug('lock has been released')
|
logger.debug('lock has been released')
|
||||||
self._locked = False
|
self._locked = False
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue