expand sw_patch config check to other deploy types

In some cases, the sw_patch service tries to ping the management ip
before it's configured, causing a service failure and the 900.002
alarm to be raised.

This commit expands a solution that has been implemented for AIO-SX
systems to other deploy types.

Test Plan:
PASS: Successful AIO-SX on VDM
PASS: Successful AIO-DX on VDM
PASS: Successful DC with 1 AIO-SX subcloud
PENDING: Apply patch before bootstrap on AIO-DX

Closes-bug:

Change-Id: I6308a91c1149aca4bef78ed175f8e02d6667944e
Signed-off-by: mmachado <matheus.machadoguilhermino@windriver.com>
This commit is contained in:
mmachado 2024-04-30 12:40:52 -03:00 committed by Matheus Machado Guilhermino
parent 4bf81b7374
commit 1547673848
2 changed files with 4 additions and 13 deletions

View File

@ -138,12 +138,8 @@ def get_mgmt_ip():
# the management IP for AIO-SX can be reconfigured during the startup.
# Check if /var/run/.<node>_config_complete exists to be sure that IP
# address will be the correct mgmt IP
try:
if tsc.system_mode == constants.SYSTEM_MODE_SIMPLEX and \
not os.path.exists(tsc.VOLATILE_CONTROLLER_CONFIG_COMPLETE):
return None
except Exception:
logging.info("not able to get system_mode, continue sw-patch services")
if not os.path.exists(tsc.VOLATILE_CONTROLLER_CONFIG_COMPLETE):
return None
mgmt_hostname = socket.gethostname()
return utils.gethostbyname(mgmt_hostname)

View File

@ -86,13 +86,8 @@ def get_mgmt_ip():
# the management IP for AIO-SX can be reconfigured during the startup.
# Check if /var/run/.<node>_config_complete exists to be sure that IP
# address will be the correct mgmt IP
try:
if tsc.system_mode == constants.SYSTEM_MODE_SIMPLEX and \
not os.path.exists(tsc.VOLATILE_CONTROLLER_CONFIG_COMPLETE):
return None
except Exception:
logging.info("not able to get system_mode, continue sw-patch services")
if not os.path.exists(tsc.VOLATILE_CONTROLLER_CONFIG_COMPLETE):
return None
mgmt_hostname = socket.gethostname()
return utils.gethostbyname(mgmt_hostname)