You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
984 B
29 lines
984 B
7 years ago
|
From 323926afbf4d1337e1bcdfc07e7d8e64f6289bf1 Mon Sep 17 00:00:00 2001
|
||
|
From: Patrick Uiterwijk <patrick@puiterwijk.org>
|
||
|
Date: Dec 07 2017 01:55:04 +0000
|
||
|
Subject: Fix encoding issue in runroot with python3
|
||
|
|
||
|
|
||
|
This will make sure that the log from the server is correctly decoded, since
|
||
|
sys.stdout only accepts strings, not raw bytes, which is what downloadTaskOutput
|
||
|
returns.
|
||
|
|
||
|
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
|
||
|
|
||
|
---
|
||
|
|
||
|
diff --git a/plugins/cli/runroot.py b/plugins/cli/runroot.py
|
||
|
index f8d4b50..dc5d737 100644
|
||
|
--- a/plugins/cli/runroot.py
|
||
|
+++ b/plugins/cli/runroot.py
|
||
|
@@ -90,7 +90,7 @@ def handle_runroot(options, session, args):
|
||
|
if 'runroot.log' in output:
|
||
|
for volume in output['runroot.log']:
|
||
|
log = session.downloadTaskOutput(task_id, 'runroot.log', volume=volume)
|
||
|
- sys.stdout.write(log)
|
||
|
+ sys.stdout.write(log.decode('utf8'))
|
||
|
info = session.getTaskInfo(task_id)
|
||
|
if info is None:
|
||
|
sys.exit(1)
|
||
|
|