diff options
author | James Cammarata <jimi@sngx.net> | 2015-09-03 07:07:29 +0200 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2015-09-03 07:07:29 +0200 |
commit | 9e1bc434c768dab26468220de4bc57490f5666cd (patch) | |
tree | a5592a80b898c3ea7c242b6c6c847bbe04ddca97 | |
parent | Move the lockfile back to tqm to make sure it stays unique (diff) | |
download | ansible-9e1bc434c768dab26468220de4bc57490f5666cd.tar.xz ansible-9e1bc434c768dab26468220de4bc57490f5666cd.zip |
Further cleanup from locking changes
-rw-r--r-- | lib/ansible/executor/task_queue_manager.py | 2 | ||||
-rw-r--r-- | lib/ansible/playbook/play_context.py | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/ansible/executor/task_queue_manager.py b/lib/ansible/executor/task_queue_manager.py index 2c47fc3975..0a1e25ea49 100644 --- a/lib/ansible/executor/task_queue_manager.py +++ b/lib/ansible/executor/task_queue_manager.py @@ -87,6 +87,8 @@ class TaskQueueManager: except ValueError: fileno = None + # A temporary file (opened pre-fork) used by connection + # plugins for inter-process locking. self._connection_lockfile = tempfile.TemporaryFile() self._workers = [] diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py index 9e3f1efb5f..e2d5feec76 100644 --- a/lib/ansible/playbook/play_context.py +++ b/lib/ansible/playbook/play_context.py @@ -161,6 +161,7 @@ class PlayContext(Base): _private_key_file = FieldAttribute(isa='string', default=C.DEFAULT_PRIVATE_KEY_FILE) _timeout = FieldAttribute(isa='int', default=C.DEFAULT_TIMEOUT) _shell = FieldAttribute(isa='string') + _connection_lockfd= FieldAttribute(isa='int') # privilege escalation fields _become = FieldAttribute(isa='bool') @@ -199,8 +200,7 @@ class PlayContext(Base): self.password = passwords.get('conn_pass','') self.become_pass = passwords.get('become_pass','') - # A temporary file (opened pre-fork) used by connection - # plugins for inter-process locking. + # a file descriptor to be used during locking operations self.connection_lockfd = connection_lockfd # set options before play to allow play to override them @@ -326,11 +326,6 @@ class PlayContext(Base): return new_info - def copy(self, exclude_block=False): - new_me = super(PlayContext, self).copy() - new_me.connection_lockfd = self.connection_lockfd - return new_me - def make_become_cmd(self, cmd, executable=None): """ helper function to create privilege escalation commands """ |