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
43b15ab9
Commit
43b15ab9
authored
Sep 16, 2015
by
Chris Church
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12385 from cchurch/winrm_put_empty_file
Enable winrm put_file to upload an empty file.
parents
93af0b32
6ab4cff7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
1 deletions
+36
-1
lib/ansible/plugins/connection/winrm.py
+1
-1
test/integration/roles/test_win_copy/files/empty.txt
+0
-0
test/integration/roles/test_win_copy/tasks/main.yml
+35
-0
No files found.
lib/ansible/plugins/connection/winrm.py
View file @
43b15ab9
...
...
@@ -224,7 +224,7 @@ class Connection(ConnectionBase):
# windows command length), divide by 2.67 (UTF16LE base64 command
# encoding), then by 1.35 again (data base64 encoding).
buffer_size
=
int
(((
8190
-
len
(
cmd
))
/
2.67
)
/
1.35
)
for
offset
in
xrange
(
0
,
in_size
,
buffer_size
):
for
offset
in
xrange
(
0
,
in_size
or
1
,
buffer_size
):
try
:
out_data
=
in_file
.
read
(
buffer_size
)
if
offset
==
0
:
...
...
test/integration/roles/test_win_copy/files/empty.txt
0 → 100644
View file @
43b15ab9
test/integration/roles/test_win_copy/tasks/main.yml
View file @
43b15ab9
...
...
@@ -19,6 +19,41 @@
-
name
:
record the output directory
set_fact
:
output_file={{win_output_dir}}/foo.txt
-
name
:
copy an empty file
win_copy
:
src
:
empty.txt
dest
:
"
{{win_output_dir}}/empty.txt"
register
:
copy_empty_result
-
name
:
check copy empty result
assert
:
that
:
-
copy_empty_result|changed
-
copy_empty_result.checksum == 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
-
name
:
stat the empty file
win_stat
:
path
:
"
{{win_output_dir}}/empty.txt"
register
:
stat_empty_result
-
name
:
check that empty file really was created
assert
:
that
:
-
stat_empty_result.stat.exists
-
stat_empty_result.stat.size == 0
-
name
:
copy an empty file again
win_copy
:
src
:
empty.txt
dest
:
"
{{win_output_dir}}/empty.txt"
register
:
copy_empty_again_result
-
name
:
check copy empty again result
assert
:
that
:
-
not copy_empty_again_result|changed
-
copy_empty_again_result.checksum == 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
-
name
:
initiate a basic copy
#- name: initiate a basic copy, and also test the mode
# win_copy: src=foo.txt dest={{output_file}} mode=0444
...
...
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