CoreNetwork: do not look up IP for CN name printing
In various places, e.g., during initialization (before deployment), we
use the name of the CN object, previously including the IP address.
However, the IP might not be available (because the CN is not deployed),
so we would get warnings at this stage. Avoid this by not looking up the
IP.
There is now one place where we have to look up the IP address
separately.
Also, the exception in initialization might be misleading if we used
{self}, because we complain about no node being present, but the {self}
would include a non-existing node name => do not use it.
This commit is contained in:
@@ -49,7 +49,7 @@ class CoreNetwork:
|
|||||||
self._host = c.get('Host').strip()
|
self._host = c.get('Host').strip()
|
||||||
if self._host == "%%current_host%%":
|
if self._host == "%%current_host%%":
|
||||||
if node is None:
|
if node is None:
|
||||||
raise Exception(f"core network {self} requires node, but none provided (cannot replace %%current_host%%)")
|
raise Exception(f"core network {cn_name} requires node, but none provided (cannot replace %%current_host%%)")
|
||||||
self._host = node
|
self._host = node
|
||||||
if d is not None:
|
if d is not None:
|
||||||
raise Exception("directory handling not implemented")
|
raise Exception("directory handling not implemented")
|
||||||
@@ -66,7 +66,7 @@ class CoreNetwork:
|
|||||||
logging.info(f'initialized core {self} from {filename}')
|
logging.info(f'initialized core {self} from {filename}')
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self._cn_name}@{self._host} [IP: {self.getIP()}]"
|
return f"{self._cn_name}@{self._host}"
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return self.__str__()
|
return self.__str__()
|
||||||
|
|||||||
@@ -862,7 +862,7 @@ class OaiCiTest():
|
|||||||
success, output = cn.deploy()
|
success, output = cn.deploy()
|
||||||
logging.info(f"deployment core network {core_name} success {success}, output:\n{output}")
|
logging.info(f"deployment core network {core_name} success {success}, output:\n{output}")
|
||||||
if success:
|
if success:
|
||||||
msg = f"Started {cn}"
|
msg = f"Started {cn} [{cn.getIP()}]"
|
||||||
HTML.CreateHtmlTestRowQueue(core_name, 'OK', [msg])
|
HTML.CreateHtmlTestRowQueue(core_name, 'OK', [msg])
|
||||||
else:
|
else:
|
||||||
msg = f"deployment of core network {core_name} FAILED"
|
msg = f"deployment of core network {core_name} FAILED"
|
||||||
|
|||||||
Reference in New Issue
Block a user