mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Enable winrm put_file to upload an empty file.
This commit is contained in:
parent
a1948dd1c1
commit
6ab4cff7db
3 changed files with 36 additions and 1 deletions
|
@ -206,7 +206,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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue