Fix fetch_file() method
This commit is contained in:
parent
8564dbaf95
commit
480ad7413a
|
@ -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