Composite arguments frequently do not have valid __str__ method
so the values were not visible.
Change-Id: If302934cb227f212580bb2f5c277a755ace51bcf
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
def add_to_papi_history(node, csit_papi_command, papi=True, **kwargs):
"""Add command to PAPI command history on DUT node.
def add_to_papi_history(node, csit_papi_command, papi=True, **kwargs):
"""Add command to PAPI command history on DUT node.
+ Repr strings are used for argument values.
+
The argument name 'csit_papi_command' must be unique enough as it cannot
be repeated in kwargs.
The argument name 'csit_papi_command' must be unique enough as it cannot
be repeated in kwargs.
if papi:
args = list()
for key, val in kwargs.iteritems():
if papi:
args = list()
for key, val in kwargs.iteritems():
- args.append("{key}={val}".format(key=key, val=val))
+ args.append("{key}={val!r}".format(key=key, val=val))
item = "{cmd}({args})".format(cmd=csit_papi_command,
args=",".join(args))
else:
item = "{cmd}({args})".format(cmd=csit_papi_command,
args=",".join(args))
else: