diff options
author | Toshio Kuratomi <toshio@fedoraproject.org> | 2016-03-16 12:47:52 -0700 |
---|---|---|
committer | Toshio Kuratomi <toshio@fedoraproject.org> | 2016-03-16 12:47:52 -0700 |
commit | 1346c209b0daed77dfc79fec6d670ba13ff66f70 (patch) | |
tree | b7e31b6b63e6324c1ac427c6075e860c30f11fba | |
parent | de306eb5da7054a001e0b630db50732bf178e8a8 (diff) | |
download | ansible-local-pipelining.tar.gz |
Add changes necessary for enabling pipelining for local connectionslocal-pipelining
-rw-r--r-- | lib/ansible/plugins/connection/local.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/ansible/plugins/connection/local.py b/lib/ansible/plugins/connection/local.py index 9a956ca735..00ee3bc707 100644 --- a/lib/ansible/plugins/connection/local.py +++ b/lib/ansible/plugins/connection/local.py @@ -19,9 +19,9 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os +import select import shutil import subprocess -import select import fcntl import getpass @@ -44,6 +44,7 @@ class Connection(ConnectionBase): ''' Local based connections ''' transport = 'local' + has_pipelining = True def _connect(self): ''' connect to the local host; nothing to do here ''' @@ -65,8 +66,6 @@ class Connection(ConnectionBase): display.debug("in local.exec_command()") - if in_data: - raise AnsibleError("Internal Error: this module does not support optimized module pipelining") executable = C.DEFAULT_EXECUTABLE.split()[0] if C.DEFAULT_EXECUTABLE else None display.vvv(u"{0} EXEC {1}".format(self._play_context.remote_addr, cmd)) @@ -112,7 +111,7 @@ class Connection(ConnectionBase): fcntl.fcntl(p.stderr, fcntl.F_SETFL, fcntl.fcntl(p.stderr, fcntl.F_GETFL) & ~os.O_NONBLOCK) display.debug("getting output with communicate()") - stdout, stderr = p.communicate() + stdout, stderr = p.communicate(in_data) display.debug("done communicating") display.debug("done with local.exec_command()") |