changed lockfile to be opened in write mode (solaris for one doesn't like

exclusive locks on read)
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
This commit is contained in:
Brian Coca 2013-05-15 16:56:20 -04:00
parent d29d142a2d
commit 8dd72d2828

View file

@ -68,12 +68,9 @@ def log_lockfile():
tempdir = tempfile.gettempdir() tempdir = tempfile.gettempdir()
uid = os.getuid() uid = os.getuid()
path = os.path.join(tempdir, ".ansible-lock.%s" % uid) path = os.path.join(tempdir, ".ansible-lock.%s" % uid)
if not os.path.exists(path):
fh = open(path, 'w')
fh.close()
return path return path
LOG_LOCK = open(log_lockfile(), 'r') LOG_LOCK = open(log_lockfile(), 'w')
def log_flock(): def log_flock():
fcntl.flock(LOG_LOCK, fcntl.LOCK_EX) fcntl.flock(LOG_LOCK, fcntl.LOCK_EX)