Usually, DICT__nodes is populated from reserved topology yaml.
But is some cases (doc generation, maybe pylint) there is no yaml.
The proper fix is to never execute any business logic
just when a module is imported.
This is just a quick workaround.
Ticket: CSIT-1793
Change-Id: I6d7250dc75d12baf120758ade8730af89431265a
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
PapiHistory.show_papi_history(node)
PapiHistory.show_papi_history(node)
-PapiHistory.reset_papi_history_on_all_duts(DICT__nodes)
+# This module can be imported outside usual Robot test context,
+# e.g. in pylint or by tools generating docs from docstrings.
+# For the tools to work, we need to avoid processing
+# when DICT__nodes value is not usable.
+if DICT__nodes:
+ PapiHistory.reset_papi_history_on_all_duts(DICT__nodes)