diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-04-14 17:23:04 +0300 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-04-14 17:23:04 +0300 |
commit | 501fb3b44f14e9c0d40a63bd8b47200b01e50be9 (patch) | |
tree | a45a01a5d0e724282f83df5b419916afd6784ca6 /scripts/automation/trex_control_plane/stf | |
parent | e0720b15ec9dc695a8c1799e87cbe41a670cb616 (diff) |
regression: python3 support
Diffstat (limited to 'scripts/automation/trex_control_plane/stf')
-rwxr-xr-x | scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py b/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py index 9ca13e17..4fd1e4c7 100755 --- a/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py +++ b/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py @@ -592,7 +592,10 @@ class CTRexClient(object): """ try: - return binascii.a2b_base64(self.server.get_trex_daemon_log()) + res = binascii.a2b_base64(self.server.get_trex_daemon_log()) + if type(res) is bytes: + return res.decode() + return res except AppError as err: self._handle_AppError_exception(err.args[0]) except ProtocolError: @@ -613,7 +616,10 @@ class CTRexClient(object): """ try: - return binascii.a2b_base64(self.server.get_trex_log()) + res = binascii.a2b_base64(self.server.get_trex_log()) + if type(res) is bytes: + return res.decode() + return res except AppError as err: self._handle_AppError_exception(err.args[0]) except ProtocolError: @@ -636,7 +642,10 @@ class CTRexClient(object): try: version_dict = OrderedDict() - result_lines = binascii.a2b_base64(self.server.get_trex_version()).split('\n') + res = binascii.a2b_base64(self.server.get_trex_version()) + if type(res) is bytes: + res = res.decode() + result_lines = res.split('\n') for line in result_lines: if not line: continue |