Fixed subprocess error reporting
Moved stdout and stderr decoding to earlier stage to prevent decode error. Note, the code is not py3 compatible. But this change doesn't introduce any new incompatibility, it changes order of existing decode calls. Change-Id: I23f7340e254ec249f00c6de9a980adac9e637983 Closes-Bug: #1399490
This commit is contained in:
parent
4b97008b0e
commit
2f9a12bcb2
@ -103,12 +103,13 @@ class RemoteCommandException(SaharaException):
|
|||||||
six.text_type(ret_code))
|
six.text_type(ret_code))
|
||||||
|
|
||||||
if stderr:
|
if stderr:
|
||||||
self.message = '%s\nSTDERR:\n%s' % (self.message, stderr)
|
self.message = '%s\nSTDERR:\n%s' % (
|
||||||
|
self.message, stderr.decode('ascii', 'ignore'))
|
||||||
|
|
||||||
if stdout:
|
if stdout:
|
||||||
self.message = '%s\nSTDOUT:\n%s' % (self.message, stdout)
|
self.message = '%s\nSTDOUT:\n%s' % (
|
||||||
|
self.message, stdout.decode('ascii', 'ignore'))
|
||||||
|
|
||||||
self.message = self.message.decode('ascii', 'ignore')
|
|
||||||
super(RemoteCommandException, self).__init__()
|
super(RemoteCommandException, self).__init__()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user