mirror of
https://github.com/Rudd-O/ansible-qubes.git
synced 2025-03-01 14:22:33 +01:00
Fix put().
This commit is contained in:
parent
d8c9d59f8e
commit
3d2dffec73
@ -63,7 +63,7 @@ class x(object):
|
|||||||
display = x()
|
display = x()
|
||||||
|
|
||||||
|
|
||||||
BUFSIZE = 1024*1024
|
BUFSIZE = 128*1024 # any bigger and it causes issues because we don't read multiple chunks until completion
|
||||||
CONNECTION_TRANSPORT = "qubes"
|
CONNECTION_TRANSPORT = "qubes"
|
||||||
CONNECTION_OPTIONS = {
|
CONNECTION_OPTIONS = {
|
||||||
'management_proxy': '--management-proxy',
|
'management_proxy': '--management-proxy',
|
||||||
@ -135,10 +135,14 @@ def put(out_path):
|
|||||||
encode_exception(e, sys.stdout)
|
encode_exception(e, sys.stdout)
|
||||||
return
|
return
|
||||||
while True:
|
while True:
|
||||||
chunksize = int(sys.stdin.readline(16))
|
#print("reading chunk size", file=sys.stderr)
|
||||||
|
chunksize = sys.stdin.readline(16)
|
||||||
|
#print("read chunk size %s" % chunksize, file=sys.stderr)
|
||||||
|
chunksize = int(chunksize)
|
||||||
if chunksize == 0:
|
if chunksize == 0:
|
||||||
break
|
break
|
||||||
chunk = sys.stdin.read(chunksize)
|
chunk = sys.stdin.read(chunksize)
|
||||||
|
assert len(chunk) == chunksize, (len(chunk), chunksize)
|
||||||
try:
|
try:
|
||||||
f.write(chunk)
|
f.write(chunk)
|
||||||
sys.stdout.write(b'Y\n')
|
sys.stdout.write(b'Y\n')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user