summaryrefslogtreecommitdiff
path: root/distbuild/initiator.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2014-10-02 12:00:47 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2014-10-02 13:09:32 +0000
commite0687d4f9014919dda15fa41b48d7ce8f6ffa401 (patch)
tree8b020e49277fdc870fbe34579f27067aad286df2 /distbuild/initiator.py
parent1f6ce63dde9d6601868d2c0fff6309fe20799917 (diff)
downloadmorph-e0687d4f9014919dda15fa41b48d7ce8f6ffa401.tar.gz
distbuild: base64-encode exec-output messages
JSON can only handle unicode strings, but commands can write anything to stdout/stderr, so let's base64 encode the data.
Diffstat (limited to 'distbuild/initiator.py')
-rw-r--r--distbuild/initiator.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/distbuild/initiator.py b/distbuild/initiator.py
index b60700fd..a803c781 100644
--- a/distbuild/initiator.py
+++ b/distbuild/initiator.py
@@ -16,6 +16,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA..
+import base64
import cliapp
import logging
import random
@@ -145,8 +146,8 @@ class Initiator(distbuild.StateMachine):
step_name = msg['step_name']
if step_name in self._step_outputs:
f = self._step_outputs[step_name]
- f.write(msg['stdout'])
- f.write(msg['stderr'])
+ f.write(base64.standard_b64decode(msg['stdout']))
+ f.write(base64.standard_b64decode(msg['stderr']))
f.flush()
else:
logging.warning(