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:
parent
e796d97624
commit
dfba4159b8
|
@ -474,7 +474,7 @@ class Instances(base.ManagerWithFind):
|
|||
lines = total_lines
|
||||
part = log_obj_to_display.pop(0)
|
||||
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"
|
||||
else:
|
||||
log_obj_to_display = sorted(
|
||||
|
@ -482,7 +482,7 @@ class Instances(base.ManagerWithFind):
|
|||
for log_part in log_obj_to_display:
|
||||
headers, log_obj = swift.get_object(container,
|
||||
log_part['name'])
|
||||
yield log_obj
|
||||
yield log_obj.decode()
|
||||
except swift_client.ClientException as ex:
|
||||
if ex.http_status == 404:
|
||||
raise exceptions.GuestLogNotFoundError()
|
||||
|
|
Loading…
Reference in New Issue