From 8dd72d282854dcca9de56623ec6d899d17a09ca4 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 15 May 2013 16:56:20 -0400 Subject: [PATCH] changed lockfile to be opened in write mode (solaris for one doesn't like exclusive locks on read) Signed-off-by: Brian Coca --- lib/ansible/callbacks.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/ansible/callbacks.py b/lib/ansible/callbacks.py index faf1b457760..57a7b292caf 100644 --- a/lib/ansible/callbacks.py +++ b/lib/ansible/callbacks.py @@ -68,12 +68,9 @@ def log_lockfile(): tempdir = tempfile.gettempdir() uid = os.getuid() path = os.path.join(tempdir, ".ansible-lock.%s" % uid) - if not os.path.exists(path): - fh = open(path, 'w') - fh.close() return path -LOG_LOCK = open(log_lockfile(), 'r') +LOG_LOCK = open(log_lockfile(), 'w') def log_flock(): fcntl.flock(LOG_LOCK, fcntl.LOCK_EX)