diff options
author | imarom <imarom@cisco.com> | 2016-03-13 17:37:36 +0200 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-03-13 17:37:36 +0200 |
commit | d935f8e440051b703175ea47077d51873f4d9504 (patch) | |
tree | 7df18e06f46b4b278a16bb94504b6c9438423d17 /scripts | |
parent | 17e720ee8611d950c56e3a873f0ac9cd2b235279 (diff) |
removed some prints and a fix for error handling on add_streams
Diffstat (limited to 'scripts')
3 files changed, 9 insertions, 8 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py index 186771d8..0f8940a2 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py @@ -1942,8 +1942,8 @@ class STLClient(object): try: profile = STLProfile.load(opts.file[0]) except STLError as e: - print format_text("\nError while loading profile '{0}'\n".format(opts.file[0]), 'bold') - print e.brief() + "\n" + self.logger.log(format_text("\nError while loading profile '{0}'\n".format(opts.file[0]), 'bold')) + self.logger.log(e.brief() + "\n") return @@ -2205,7 +2205,7 @@ class STLClient(object): self.start(ports = opts.ports, duration = opts.duration, force = opts.force) except STLError as e: - print e.brief() + stl.logger.log(e.brief()) return return True @@ -2229,7 +2229,7 @@ class STLClient(object): try: self.set_port_attr(opts.ports, opts.prom) except STLError as e: - print e.brief() + stl.logger.log(brief()) return diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py index 1ffeffe0..ab368d70 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py @@ -229,7 +229,7 @@ class Port(object): ret = RC() for i, single_rc in enumerate(rc): - if single_rc: + if single_rc.rc: stream_id = batch[i].params['stream_id'] next_id = batch[i].params['stream']['next_stream_id'] self.streams[stream_id] = {'next_id' : next_id, @@ -238,11 +238,12 @@ class Port(object): 'rate' : streams_list[i].get_rate()} ret.add(RC_OK(data = stream_id)) - + else: + ret.add(RC(*single_rc)) self.state = self.STATE_STREAMS if (len(self.streams) > 0) else self.STATE_IDLE - return ret if rc else self.err(str(rc)) + return ret if ret else self.err(str(ret)) diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py index 496bea13..bd48f939 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py @@ -5,7 +5,7 @@ from trex_stl_exceptions import * import types RpcCmdData = namedtuple('RpcCmdData', ['method', 'params']) -TupleRC = namedtuple('RC', ['rc', 'data', 'is_warn']) +TupleRC = namedtuple('RCT', ['rc', 'data', 'is_warn']) class RpcResponseStatus(namedtuple('RpcResponseStatus', ['success', 'id', 'msg'])): __slots__ = () |