X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FPapiHistory.py;h=32429c4f641debd80a9cd6fe1254680e609363ce;hb=bd15bb418bf618ff3055fb25c339778d12c1eaef;hp=cacfbd6b194ff760aa2d504838b6e0c0b2f465a1;hpb=d68951ac245150eeefa6e0f4156e4c1b5c9e9325;p=csit.git diff --git a/resources/libraries/python/PapiHistory.py b/resources/libraries/python/PapiHistory.py index cacfbd6b19..32429c4f64 100644 --- a/resources/libraries/python/PapiHistory.py +++ b/resources/libraries/python/PapiHistory.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Cisco and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -120,4 +120,9 @@ class PapiHistory: 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)