mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix fetch_file() method
This commit is contained in:
parent
d0d9be30d5
commit
e461241d7b
3 changed files with 9 additions and 3 deletions
|
@ -140,8 +140,10 @@ class Connection(object):
|
|||
|
||||
with open(out_path, 'wb+') as out_file:
|
||||
try:
|
||||
for chunk in p.stdout.read(BUFSIZE):
|
||||
chunk = p.stdout.read(BUFSIZE)
|
||||
while chunk:
|
||||
out_file.write(chunk)
|
||||
chunk = p.stdout.read(BUFSIZE)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
raise errors.AnsibleError("failed to transfer file %s to %s" % (in_path, out_path))
|
||||
|
|
|
@ -162,8 +162,10 @@ class Connection(object):
|
|||
|
||||
with open(out_path, 'wb+') as out_file:
|
||||
try:
|
||||
for chunk in p.stdout.read(BUFSIZE):
|
||||
chunk = p.stdout.read(BUFSIZE)
|
||||
while chunk:
|
||||
out_file.write(chunk)
|
||||
chunk = p.stdout.read(BUFSIZE)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
raise errors.AnsibleError("failed to transfer file %s to %s" % (in_path, out_path))
|
||||
|
|
|
@ -177,8 +177,10 @@ class Connection(object):
|
|||
|
||||
with open(out_path, 'wb+') as out_file:
|
||||
try:
|
||||
for chunk in p.stdout.read(BUFSIZE):
|
||||
chunk = p.stdout.read(BUFSIZE)
|
||||
while chunk:
|
||||
out_file.write(chunk)
|
||||
chunk = p.stdout.read(BUFSIZE)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
raise errors.AnsibleError("failed to transfer file %s to %s" % (in_path, out_path))
|
||||
|
|
Loading…
Reference in a new issue