aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/VppConfigGenerator.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python/VppConfigGenerator.py')
-rw-r--r--resources/libraries/python/VppConfigGenerator.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py
index 88fbb317c4..02f7cf725d 100644
--- a/resources/libraries/python/VppConfigGenerator.py
+++ b/resources/libraries/python/VppConfigGenerator.py
@@ -55,8 +55,8 @@ class VppConfigGenerator:
"""Initialize library."""
# VPP Node to apply configuration on
self._node = u""
- # VPP Hostname
- self._hostname = u""
+ # Topology node key
+ self._node_key = u""
# VPP Configuration
self._nodeconfig = dict()
# Serialized VPP Configuration
@@ -70,11 +70,13 @@ class VppConfigGenerator:
# VPP Startup config backup location
self._vpp_startup_conf_backup = None
- def set_node(self, node):
+ def set_node(self, node, node_key=None):
"""Set DUT node.
:param node: Node to store configuration on.
+ :param node_key: Topology node key.
:type node: dict
+ :type node_key: str
:raises RuntimeError: If Node type is not DUT.
"""
if node[u"type"] != NodeType.DUT:
@@ -82,7 +84,7 @@ class VppConfigGenerator:
u"Startup config can only be applied to DUTnode."
)
self._node = node
- self._hostname = Topology.get_node_hostname(node)
+ self._node_key = node_key
def set_vpp_logfile(self, logfile):
"""Set VPP logfile location.
@@ -612,7 +614,7 @@ class VppConfigGenerator:
"""
self.write_config(filename=filename)
- VPPUtil.restart_vpp_service(self._node)
+ VPPUtil.restart_vpp_service(self._node, self._node_key)
if verify_vpp:
VPPUtil.verify_vpp(self._node)