From 6f619bc896bf5149d991e06af84c85616330286b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 22 Jul 2022 13:23:47 -0400 Subject: [PATCH] Change ipaddr to a property for allowing logic --- confluent_server/confluent/discovery/handlers/generic.py | 8 ++++++-- confluent_server/confluent/discovery/handlers/pxe.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/confluent_server/confluent/discovery/handlers/generic.py b/confluent_server/confluent/discovery/handlers/generic.py index 0d41d366..2e941238 100644 --- a/confluent_server/confluent/discovery/handlers/generic.py +++ b/confluent_server/confluent/discovery/handlers/generic.py @@ -32,7 +32,7 @@ class NodeHandler(object): self.info = info self.configmanager = configmanager targsa = [None] - self.ipaddr = None + self._ipaddr = None self.relay_url = None self.relay_server = None self.web_ip = None @@ -50,7 +50,7 @@ class NodeHandler(object): else: if info.get('addresses', False): targsa = info['addresses'][0] - self.ipaddr = socket.getnameinfo( + self._ipaddr = socket.getnameinfo( targsa, socket.NI_NUMERICHOST|socket.NI_NUMERICSERV)[0] @classmethod @@ -103,6 +103,10 @@ class NodeHandler(object): return user, passwd, not havecustomcreds + @property + def ipaddr(self): + return self._ipaddr + @property def cert_fail_reason(self): if self._certfailreason == 1: diff --git a/confluent_server/confluent/discovery/handlers/pxe.py b/confluent_server/confluent/discovery/handlers/pxe.py index 2b43ffbd..02f9fef2 100644 --- a/confluent_server/confluent/discovery/handlers/pxe.py +++ b/confluent_server/confluent/discovery/handlers/pxe.py @@ -24,7 +24,7 @@ class NodeHandler(generic.NodeHandler): devname = 'PXE' def __init__(self, info, configmanager): - self.ipaddr = '' + self._ipaddr = '' self.cfm = configmanager @property