summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuigi Toscano <ltoscano@redhat.com>2019-05-29 01:00:37 +0200
committerLuigi Toscano <ltoscano@redhat.com>2019-05-31 11:50:07 +0200
commitac714f3c4700c235fe052a80edf5514a2e561fd8 (patch)
treee8257a31cdbf69504f25be958ce2287412ad22aa
parentc53831d686d9e94187ce5dfdbfa43883b792280e (diff)
downloadpython-saharaclient-ac714f3c4700c235fe052a80edf5514a2e561fd8.tar.gz
Py3: fix the OSC download job binary command
Story: 2005807 Task: 33546 Change-Id: I01660375c17938f1eb2920cf0d599083d3d300e1
-rw-r--r--releasenotes/notes/fix-job-binary-download-py3-5592eca2345305bd.yaml4
-rw-r--r--saharaclient/osc/v1/job_binaries.py2
2 files changed, 5 insertions, 1 deletions
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 '