issue #186: finally enable detach.

pull/262/head
David Wilson 6 years ago
parent 05e0b134f9
commit ae20a689ef

@ -462,9 +462,9 @@ class NewStyleRunner(ScriptRunner):
def _setup_imports(self):
"""
Ensure the local importer has loaded every module needed by the Ansible
module before setup() completes, but before detach() is called in an
asynchronous task.
Ensure the local importer and PushFileService has everything for the
Ansible module before setup() completes, but before detach() is called
in an asynchronous task.
The master automatically streams modules towards us concurrent to the
runner invocation, however there is no public API to synchronize on the
@ -476,6 +476,10 @@ class NewStyleRunner(ScriptRunner):
mitogen.core.import_module(fullname)
for fullname in self.module_map['builtin']:
mitogen.core.import_module(fullname)
self.source = ansible_mitogen.target.get_small_file(
context=self.service_context,
path=self.path,
)
def setup(self):
super(NewStyleRunner, self).setup()
@ -511,11 +515,6 @@ class NewStyleRunner(ScriptRunner):
pass
def _get_code(self):
self.source = ansible_mitogen.target.get_small_file(
context=self.service_context,
path=self.path,
)
try:
return self._code_by_path[self.path]
except KeyError:

@ -302,8 +302,8 @@ def _run_module_async(kwargs, job_id, econtext):
'pid': os.getpid()
})
#kwargs['detach'] = True
#kwargs['econtext'] = econtext
kwargs['detach'] = True
kwargs['econtext'] = econtext
kwargs['emulate_tty'] = False
dct = run_module(kwargs)
if mitogen.core.PY3:

Loading…
Cancel
Save