mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Close all open filehandle (#50544)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
94a1d86d70
commit
db8702cdb8
21 changed files with 81 additions and 47 deletions
|
@ -86,7 +86,8 @@ class Connection(ConnectionBase):
|
|||
|
||||
out_path = self._normalize_path(out_path, '/')
|
||||
self._display.vvv("PUT %s TO %s" % (in_path, out_path), host=self.host)
|
||||
content = open(in_path).read()
|
||||
with open(in_path) as in_fh:
|
||||
content = in_fh.read()
|
||||
self.client.cmd(self.host, 'file.write', [out_path, content])
|
||||
|
||||
# TODO test it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue