mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Fix fetch_file() method
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user