disabled ssh closing connections

This commit is contained in:
Brian Coca 2015-09-09 14:21:46 -04:00
parent 56d7f3889d
commit 3f0e14c2a0

View file

@ -514,17 +514,18 @@ class Connection(ConnectionBase):
raise AnsibleError("failed to transfer file from {0}:\n{1}\n{2}".format(in_path, stdout, stderr)) raise AnsibleError("failed to transfer file from {0}:\n{1}\n{2}".format(in_path, stdout, stderr))
def close(self): def close(self):
''' not applicable since we're executing openssh binaries '''
if self._connected: if self._connected:
if 'ControlMaster' in self._common_args: # TODO: reenable once winrm issues are fixed
cmd = ['ssh','-O','stop'] # temporarily disabled as we are forced to currently close connections after every task because of winrm
cmd.extend(self._common_args) #if and 'ControlMaster' in self._common_args:
cmd.append(self._play_context.remote_addr) # cmd = ['ssh','-O','stop']
# cmd.extend(self._common_args)
# cmd.append(self._play_context.remote_addr)
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate() # stdout, stderr = p.communicate()
self._connected = False self._connected = False