mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add changes necessary for enabling pipelining for local connections
This commit is contained in:
parent
de306eb5da
commit
1346c209b0
1 changed files with 3 additions and 4 deletions
|
@ -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()")
|
||||
|
|
Loading…
Reference in a new issue