From 72a86301f00b9cc427ea5b6be2730cf0d4fe86d4 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 21 Feb 2024 15:10:29 +0100 Subject: [PATCH] test/infamy: save location data for Device and add address() method Signed-off-by: Joachim Wiberg --- test/infamy/netconf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/infamy/netconf.py b/test/infamy/netconf.py index 30766510..d3e62e7c 100644 --- a/test/infamy/netconf.py +++ b/test/infamy/netconf.py @@ -89,6 +89,7 @@ class Device(object): yangdir: None | str = None, factory_default = True): + self.location = location self.mapping = mapping self.location = location self.ly = libyang.Context(yangdir) @@ -182,6 +183,10 @@ class Device(object): return list(filter(lambda m: m["name"] in modnames, self.modules.values())) + def address(self): + """Return managment IP address used for NETCONF""" + return self.location.host + def _ncc_make_rpc(self, guts, msg_id=None): if not msg_id: msg_id = uuid.uuid4()