Fixed issues on Python 3

Change-Id: Ib41255ba8b2ddbe9b05c8503a90e5271ed74a7d6
This commit is contained in:
Artem Tiumentcev 2016-11-24 19:11:39 +03:00
parent d9237d0225
commit 01d6a8114f
3 changed files with 7 additions and 3 deletions

View File

@ -33,6 +33,8 @@ class Message(object):
try:
if message_handle:
if isinstance(message_handle.body, bytes):
message_handle.body = message_handle.body.decode('utf-8')
self.body = anyjson.loads(message_handle.body)
else:
self.body = None

View File

@ -43,7 +43,7 @@ class ExecutionPlanRunner(object):
@staticmethod
def _unindent(script, initial_indent):
lines = script.expandtabs(4).split('\n')
min_indent = sys.maxint
min_indent = six.MAXSIZE
for line in lines:
indent = -1
for i, c in enumerate(line):

View File

@ -70,11 +70,13 @@ class ApplicationExecutor(object):
LOG.debug("Script {0} execution finished "
"with retcode: {1}".format(script_name, retcode))
if stdout is not None:
stdout = stdout.decode('utf-8')
if hasattr(stdout, 'decode'):
stdout = stdout.decode('utf-8')
LOG.debug(u"'{0}' execution stdout: "
u"'{1}'".format(script_name, stdout))
if stderr is not None:
stderr = stderr.decode('utf-8')
if hasattr(stderr, 'decode'):
stderr = stderr.decode('utf-8')
LOG.debug(u"'{0}' execution stderr: "
u"'{1}'".format(script_name, stderr))
result = {