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
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
try:
self.set_port_attr(opts.ports, opts.prom)
except STLError as e:
- print e.brief()
+ stl.logger.log(brief())
return
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,
'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))
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__ = ()