summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuigi Toscano <ltoscano@redhat.com>2019-05-29 01:00:37 +0200
committerLuigi Toscano <ltoscano@redhat.com>2019-06-13 20:10:35 +0200
commit564380af2e297c86d31af092fdbb64a735b2d669 (patch)
treeec045880fa8ecdbc3c0f8a1dbf550c1cf8b05c8a
parentee66632ae067b16978dedc929f1637fc79e0ea6f (diff)
downloadpython-saharaclient-stable/stein.tar.gz
Py3: fix the OSC download job binary commandstein-em2.2.1stable/stein
Story: 2005807 Task: 33546 Change-Id: I01660375c17938f1eb2920cf0d599083d3d300e1 (cherry picked from commit ac714f3c4700c235fe052a80edf5514a2e561fd8)
-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 '