X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FPapiExecutor.py;h=f4d01704b389b1f0db2692b4405e680367692cfd;hb=refs%2Fchanges%2F72%2F31272%2F1;hp=46fe5d583b61327bd272deeed1d0461a1c7020e2;hpb=6717a3bc8b5fb81c1a19964fd367878230331457;p=csit.git diff --git a/resources/libraries/python/PapiExecutor.py b/resources/libraries/python/PapiExecutor.py index 46fe5d583b..f4d01704b3 100644 --- a/resources/libraries/python/PapiExecutor.py +++ b/resources/libraries/python/PapiExecutor.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 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: @@ -23,6 +23,8 @@ import subprocess import sys import tempfile import time +from collections import UserDict + from pprint import pformat from robot.api import logger @@ -63,11 +65,11 @@ def dictize(obj): """ if not hasattr(obj, u"_asdict"): return obj - ret = obj._asdict() - old_get = ret.__getitem__ + overriden = UserDict(obj._asdict()) + old_get = overriden.__getitem__ new_get = lambda self, key: dictize(old_get(self, key)) - ret.__getitem__ = new_get - return ret + overriden.__getitem__ = new_get + return overriden class PapiSocketExecutor: