aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2019-03-07 13:00:22 +0100
committerVratko Polak <vrpolak@cisco.com>2019-03-07 13:00:22 +0100
commit1999c2ecc15760a57bdf34498635432ddb0321e0 (patch)
tree19081b92f20ef72fdea7b23c3db3d5b16ad4b404 /resources/libraries/python
parent0c45de2af90637065a799f95e3353e57fdb49065 (diff)
Simplify show_papi_history
Change-Id: Id86f8630ff37e958d90011f421aeb8a75b3e4783 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/PapiHistory.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/resources/libraries/python/PapiHistory.py b/resources/libraries/python/PapiHistory.py
index eede0d250f..ec5b1675eb 100644
--- a/resources/libraries/python/PapiHistory.py
+++ b/resources/libraries/python/PapiHistory.py
@@ -84,12 +84,12 @@ class PapiHistory(object):
:param node: DUT node to show PAPI command history for.
:type node: dict
"""
- history = "\nNo PAPI command executed"
- if DICT__DUTS_PAPI_HISTORY[node['host']]:
- history = "".join(["\n{}".format(
- cmd) for cmd in DICT__DUTS_PAPI_HISTORY[node['host']]])
+ history_list = DICT__DUTS_PAPI_HISTORY[node['host']]
+ if not history_list:
+ history_list = ("No PAPI command executed", )
logger.trace(
- "{0} PAPI command history:\n{1}\n".format(node['host'], history))
+ "{0} PAPI command history:\n{1}\n".format(
+ node['host'], "\n".join(history_list)))
@staticmethod
def show_papi_history_on_all_duts(nodes):