mirror of
https://github.com/ansible/ansible.git
synced 2026-08-02 00:22:14 +02:00
Add explicit calls to close connections
This commit is contained in:
@@ -127,12 +127,14 @@ class Runner(object):
|
|||||||
self._exec_command(conn, "chmod +x %s" % outpath)
|
self._exec_command(conn, "chmod +x %s" % outpath)
|
||||||
cmd = self._command(outpath)
|
cmd = self._command(outpath)
|
||||||
result = self._exec_command(conn, cmd)
|
result = self._exec_command(conn, cmd)
|
||||||
|
conn.close()
|
||||||
return [ host, True, json.loads(result) ]
|
return [ host, True, json.loads(result) ]
|
||||||
else:
|
else:
|
||||||
# SFTP file copy module is not really a module
|
# SFTP file copy module is not really a module
|
||||||
ftp = conn.open_sftp()
|
ftp = conn.open_sftp()
|
||||||
ftp.put(self.module_args[0], self.module_args[1])
|
ftp.put(self.module_args[0], self.module_args[1])
|
||||||
ftp.close()
|
ftp.close()
|
||||||
|
conn.close()
|
||||||
return [ host, True, 1 ]
|
return [ host, True, 1 ]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user