diff options
author | Marcin Piwowarczyk <m.piwowarczy@samsung.com> | 2018-10-27 20:27:54 +0200 |
---|---|---|
committer | Lingxian Kong <anlin.kong@gmail.com> | 2019-10-04 08:07:26 +1300 |
commit | c3d667971d7c48cd6e069851252e494962fc251a (patch) | |
tree | 8876186dc438329083e1049d4c0f2ab56013a94a /troveclient/v1/instances.py | |
parent | 7ac06f0e4b9cc540fdb9959be76e43e9c6bfe5df (diff) | |
download | python-troveclient-stable/stein.tar.gz |
Add python3 compatibility for guest logs featuresstein-em2.17.1stable/stein
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>
(cherry picked from commit dfba4159b8153dca0d237eff990d827dc3fc6321)
Diffstat (limited to 'troveclient/v1/instances.py')
-rw-r--r-- | troveclient/v1/instances.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/troveclient/v1/instances.py b/troveclient/v1/instances.py index eb5aec8..0de2d9b 100644 --- a/troveclient/v1/instances.py +++ b/troveclient/v1/instances.py @@ -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() |