Forget about the old BYPASS_LOCK thing from actionmap

This commit is contained in:
Alexandre Aubin 2017-08-13 16:40:44 -04:00
parent 9006f8980f
commit ab47f30f18
3 changed files with 1 additions and 15 deletions

View file

@ -430,7 +430,6 @@ class MoulinetteLock(object):
self._lockfile = '/var/run/moulinette_%s.lock' % namespace
self._stale_checked = False
self._locked = False
self._bypass = False
def acquire(self):
"""Attempt to acquire the lock for the moulinette instance
@ -443,10 +442,6 @@ class MoulinetteLock(object):
start_time = time.time()
while True:
if 'BYPASS_LOCK' in os.environ and os.environ['BYPASS_LOCK'] == 'yes':
self._bypass = True
break
lock_pid = self._lock_PID()
if lock_pid is None:
@ -477,9 +472,7 @@ class MoulinetteLock(object):
"""
if self._locked:
if not self._bypass:
os.unlink(self._lockfile)
os.unlink(self._lockfile)
logger.debug('lock has been released')
self._locked = False

View file

@ -152,10 +152,6 @@ class BaseActionsMapParser(object):
namespace = argparse.Namespace()
namespace._tid = tid
# Check lock
if not self.get_conf(tid, 'lock'):
os.environ['BYPASS_LOCK'] = 'yes'
# Perform authentication if needed
if self.get_conf(tid, 'authenticate'):
auth_conf, cls = self.get_conf(tid, 'authenticator')

View file

@ -634,9 +634,6 @@ class ActionsMapParser(BaseActionsMapParser):
raise MoulinetteError(errno.EINVAL, m18n.g('error_see_log'))
ret = argparse.Namespace()
if not self.get_conf(tid, 'lock'):
os.environ['BYPASS_LOCK'] = 'yes'
# Perform authentication if needed
if self.get_conf(tid, 'authenticate'):
# TODO: Clean this hard fix and find a way to set an authenticator