-# 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:
import sys
import tempfile
import time
+from collections import UserDict
+
from pprint import pformat
from robot.api import logger
"""
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:
reply = papi_exec.add(cmd, **args).get_reply(err_msg)["reply"]
if log:
logger.info(
- f"{cmd} ({node[u'host']} - {remote_vpp_socket}):\n"
+ f"{cli_cmd} ({node[u'host']} - {remote_vpp_socket}):\n"
f"{reply.strip()}"
)
return reply