mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
Move the lockfile back to tqm to make sure it stays unique
This commit is contained in:
parent
ba658ff3a9
commit
b93f27e260
3 changed files with 14 additions and 12 deletions
|
@ -23,6 +23,7 @@ import multiprocessing
|
|||
import os
|
||||
import socket
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible.errors import AnsibleError
|
||||
|
@ -86,6 +87,8 @@ class TaskQueueManager:
|
|||
except ValueError:
|
||||
fileno = None
|
||||
|
||||
self._connection_lockfile = tempfile.TemporaryFile()
|
||||
|
||||
self._workers = []
|
||||
for i in range(self._options.forks):
|
||||
main_q = multiprocessing.Queue()
|
||||
|
@ -176,7 +179,7 @@ class TaskQueueManager:
|
|||
new_play = play.copy()
|
||||
new_play.post_validate(templar)
|
||||
|
||||
play_context = PlayContext(new_play, self._options, self.passwords)
|
||||
play_context = PlayContext(new_play, self._options, self.passwords, self._connection_lockfile.fileno())
|
||||
for callback_plugin in self._callback_plugins:
|
||||
if hasattr(callback_plugin, 'set_play_context'):
|
||||
callback_plugin.set_play_context(play_context)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue