Add python3 compatibility for guest logs features
During working with python3-first goals, I have notticed the log_generator and log_save methods was non compliance with python3. This is what doesn't appears in integration tests because we execute only trove-functional-mysql job which doesn't covers guest-log tests. In separate change I will extend zull definition by scenario tests to avoid similar issues in future. Change-Id: If85dff57afe110991553d510c6af4468a6781f64 Signed-off-by: Marcin Piwowarczyk <m.piwowarczy@samsung.com>
This commit is contained in:
@@ -474,7 +474,7 @@ class Instances(base.ManagerWithFind):
|
|||||||
lines = total_lines
|
lines = total_lines
|
||||||
part = log_obj_to_display.pop(0)
|
part = log_obj_to_display.pop(0)
|
||||||
hdrs, log_obj = swift.get_object(container, part['name'])
|
hdrs, log_obj = swift.get_object(container, part['name'])
|
||||||
log_by_lines = log_obj.splitlines()
|
log_by_lines = log_obj.decode().splitlines()
|
||||||
yield "\n".join(log_by_lines[-1 * lines:]) + "\n"
|
yield "\n".join(log_by_lines[-1 * lines:]) + "\n"
|
||||||
else:
|
else:
|
||||||
log_obj_to_display = sorted(
|
log_obj_to_display = sorted(
|
||||||
@@ -482,7 +482,7 @@ class Instances(base.ManagerWithFind):
|
|||||||
for log_part in log_obj_to_display:
|
for log_part in log_obj_to_display:
|
||||||
headers, log_obj = swift.get_object(container,
|
headers, log_obj = swift.get_object(container,
|
||||||
log_part['name'])
|
log_part['name'])
|
||||||
yield log_obj
|
yield log_obj.decode()
|
||||||
except swift_client.ClientException as ex:
|
except swift_client.ClientException as ex:
|
||||||
if ex.http_status == 404:
|
if ex.http_status == 404:
|
||||||
raise exceptions.GuestLogNotFoundError()
|
raise exceptions.GuestLogNotFoundError()
|
||||||
|
Reference in New Issue
Block a user