aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2019-07-24 09:49:05 +0200
committerVratko Polak <vrpolak@cisco.com>2019-08-06 08:40:42 +0000
commitfb3aba8bd6418418d9b3741839c4b305d8c72a4e (patch)
tree9a0f584fec8dd8b9109c14bca580982ef264f4cd /resources/libraries/python
parent916de0c14aae522b889c3f824659f56a39490b48 (diff)
PapiHistory: Use repr strings for argument values
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>
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/PapiHistory.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/resources/libraries/python/PapiHistory.py b/resources/libraries/python/PapiHistory.py
index 6a4f913d03..c4ee4ee495 100644
--- a/resources/libraries/python/PapiHistory.py
+++ b/resources/libraries/python/PapiHistory.py
@@ -51,6 +51,8 @@ class PapiHistory(object):
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.
@@ -84,7 +86,7 @@ class PapiHistory(object):
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: