Docker environment: check for None on stdout/stderr response
Docker returns None if there wasn't anything printed
to stdout/stderr.
@@ -315,8 +315,10 @@ class DockerBuildCommand(BuildCommand):
cmd_stdout, cmd_stderr = out
else:
cmd_stdout = out
- self.output = self.sanitize_output(cmd_stdout)
- self.error = self.sanitize_output(cmd_stderr)
+ # Docker returns None when there's no stderr/stdout
+ # so we need to convert that to a string.
+ self.output = self.sanitize_output(cmd_stdout or "")
+ self.error = self.sanitize_output(cmd_stderr or "")
cmd_ret = client.exec_inspect(exec_id=exec_cmd['Id'])
self.exit_code = cmd_ret['ExitCode']
