2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 11:01:09 +00:00

Allow -o with data file

This makes things like ssh key signing easier.
This commit is contained in:
Jarrod Johnson 2022-03-03 08:25:04 -05:00
parent 15e7e4464e
commit 003196bc9e

View File

@ -403,6 +403,8 @@ if __name__ == '__main__':
errout = sys.argv.pop(errout)
except ValueError:
errout = None
if len(sys.argv) > 2 and os.path.exists(sys.argv[-1]):
data = open(sys.argv[-1]).read()
if outbin:
with open(outbin, 'ab+') as outf:
reader = HTTPSClient(usejson=usejson, errout=errout).grab_url(
@ -412,8 +414,6 @@ if __name__ == '__main__':
outf.write(chunk)
chunk = reader.read(16384)
sys.exit(0)
if len(sys.argv) > 2 and os.path.exists(sys.argv[-1]):
data = open(sys.argv[-1]).read()
if waitfor:
client = HTTPSClient(usejson, errout=errout)
status = 201