diff options
author | imarom <imarom@cisco.com> | 2016-03-21 14:48:00 +0200 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-03-21 14:49:07 +0200 |
commit | f72c6df9d2e9998ae1f3529d729ab7930b35785a (patch) | |
tree | d4301fa01faf1bf5dedd6da66af44295ad77a2db /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py | |
parent | b9c241cb1445701dc3bf77527cecf6e4db201d0b (diff) |
python 3 support for package - phase 1
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py index ae6cb497..0f0fe83e 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py @@ -8,11 +8,11 @@ import zmq import re import random -from trex_stl_jsonrpc_client import JsonRpcClient, BatchMessage +from .trex_stl_jsonrpc_client import JsonRpcClient, BatchMessage -from utils.text_opts import * -from trex_stl_stats import * -from trex_stl_types import * +from .utils.text_opts import * +from .trex_stl_stats import * +from .trex_stl_types import * # basic async stats class class CTRexAsyncStats(object): @@ -102,7 +102,7 @@ class CTRexAsyncStatsManager(): port_stats = {} # filter the values per port and general - for key, value in snapshot.iteritems(): + for key, value in snapshot.items(): # match a pattern of ports m = re.search('(.*)\-([0-8])', key) @@ -124,7 +124,7 @@ class CTRexAsyncStatsManager(): self.general_stats.update(general_stats) # update all ports - for port_id, data in port_stats.iteritems(): + for port_id, data in port_stats.items(): if not port_id in self.port_stats: self.port_stats[port_id] = CTRexAsyncStatsPort() @@ -209,7 +209,7 @@ class CTRexAsyncClient(): def _run (self): # socket must be created on the same thread - self.socket.setsockopt(zmq.SUBSCRIBE, '') + self.socket.setsockopt(zmq.SUBSCRIBE, b'') self.socket.setsockopt(zmq.RCVTIMEO, 5000) self.socket.connect(self.tr) @@ -316,7 +316,7 @@ class CTRexAsyncClient(): return rc # fast loop - for i in xrange(0, 100): + for i in range(0, 100): if self.async_barrier['ack']: break time.sleep(0.001) |