Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
e338c743
Commit
e338c743
authored
Oct 23, 2013
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fix for putting 0-length files over accelerated connections
Fixes #4652
parent
4bc70f0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lib/ansible/runner/connection_plugins/accelerate.py
+4
-2
No files found.
lib/ansible/runner/connection_plugins/accelerate.py
View file @
e338c743
...
...
@@ -200,9 +200,10 @@ class Connection(object):
fstat
=
os
.
stat
(
in_path
)
try
:
vvv
(
"PUT file is
%
d bytes"
%
fstat
.
st_size
)
while
fd
.
tell
()
<
fstat
.
st_size
:
last
=
False
while
fd
.
tell
()
<=
fstat
.
st_size
and
not
last
:
vvvv
(
"file position currently
%
ld, file size is
%
ld"
%
(
fd
.
tell
(),
fstat
.
st_size
))
data
=
fd
.
read
(
CHUNK_SIZE
)
last
=
False
if
fd
.
tell
()
>=
fstat
.
st_size
:
last
=
True
data
=
dict
(
mode
=
'put'
,
data
=
base64
.
b64encode
(
data
),
out_path
=
out_path
,
last
=
last
)
...
...
@@ -224,6 +225,7 @@ class Connection(object):
raise
errors
.
AnsibleError
(
"failed to put the file in the requested location"
)
finally
:
fd
.
close
()
vvvv
(
"waiting for final response after PUT"
)
response
=
self
.
recv_data
()
if
not
response
:
raise
errors
.
AnsibleError
(
"Failed to get a response from
%
s"
%
self
.
host
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment