From 003196bc9e2057c444d73a36d2877298eb896867 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 3 Mar 2022 08:25:04 -0500 Subject: [PATCH] Allow -o with data file This makes things like ssh key signing easier. --- .../common/initramfs/opt/confluent/bin/apiclient | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient b/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient index a22f9efd..579c9f86 100644 --- a/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient +++ b/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient @@ -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