diff options
-rwxr-xr-x | lorry-controller-minion | 3 | ||||
-rw-r--r-- | lorrycontroller/gerrit.py | 5 | ||||
-rw-r--r-- | lorrycontroller/gitano.py | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/lorry-controller-minion b/lorry-controller-minion index 0412629..4f3069e 100755 --- a/lorry-controller-minion +++ b/lorry-controller-minion @@ -298,6 +298,9 @@ class MINION(cliapp.Application): def disk_usage_by_dir(self, dirname): exit, out, err = cliapp.runcmd_unchecked(['du', '-sk', dirname]) + if isinstance(out, bytes): + out = out.decode('utf-8', errors='replace') + err = err.decode('utf-8', errors='replace') if exit: logging.error('du -sk %s failed: %r', dirname, err) return 0 diff --git a/lorrycontroller/gerrit.py b/lorrycontroller/gerrit.py index 042a621..6ae24e3 100644 --- a/lorrycontroller/gerrit.py +++ b/lorrycontroller/gerrit.py @@ -34,7 +34,10 @@ class Gerrit(object): '%s@%s' % (user, host)] def _ssh_command(self, command): - return cliapp.runcmd(self._ssh_command_args + command) + out = cliapp.runcmd(self._ssh_command_args + command) + if isinstance(out, bytes): + out = out.decode('utf-8', errors='replace') + return out def has_project(self, name): # There's no 'does this project exist' command in Gerrit 2.9.4; 'list diff --git a/lorrycontroller/gitano.py b/lorrycontroller/gitano.py index d0d1a0c..b5b860c 100644 --- a/lorrycontroller/gitano.py +++ b/lorrycontroller/gitano.py @@ -91,6 +91,9 @@ class GitanoCommand(object): exit, stdout, stderr = cliapp.runcmd_unchecked( base_argv + quoted_args) + if isinstance(stdout, bytes): + stdout = stdout.decode('utf-8', errors='replace') + stderr = stderr.decode('utf-8', errors='replace') if exit != 0: logging.error( |