From 564380af2e297c86d31af092fdbb64a735b2d669 Mon Sep 17 00:00:00 2001 From: Luigi Toscano Date: Wed, 29 May 2019 01:00:37 +0200 Subject: Py3: fix the OSC download job binary command Story: 2005807 Task: 33546 Change-Id: I01660375c17938f1eb2920cf0d599083d3d300e1 (cherry picked from commit ac714f3c4700c235fe052a80edf5514a2e561fd8) --- releasenotes/notes/fix-job-binary-download-py3-5592eca2345305bd.yaml | 4 ++++ saharaclient/osc/v1/job_binaries.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-job-binary-download-py3-5592eca2345305bd.yaml diff --git a/releasenotes/notes/fix-job-binary-download-py3-5592eca2345305bd.yaml b/releasenotes/notes/fix-job-binary-download-py3-5592eca2345305bd.yaml new file mode 100644 index 0000000..5b33fa8 --- /dev/null +++ b/releasenotes/notes/fix-job-binary-download-py3-5592eca2345305bd.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fix the "job binary download" command when Python 3 is used. diff --git a/saharaclient/osc/v1/job_binaries.py b/saharaclient/osc/v1/job_binaries.py index 8333c27..0d5fcbe 100644 --- a/saharaclient/osc/v1/job_binaries.py +++ b/saharaclient/osc/v1/job_binaries.py @@ -506,7 +506,7 @@ class DownloadJobBinary(command.Command): client.job_binaries, parsed_args.job_binary) data = client.job_binaries.get_file(jb_id) - with open(parsed_args.file, 'w') as f: + with open(parsed_args.file, 'wb') as f: f.write(data) sys.stdout.write( 'Job binary "{jb}" has been downloaded ' -- cgit v1.2.1