From c9d1a9f8c63a1ddea170fd2ccef576eabecda9e1 Mon Sep 17 00:00:00 2001 From: mmachado Date: Tue, 30 Apr 2024 12:40:52 -0300 Subject: [PATCH] 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 (VDM) PASS: Successful AIO-DX (VDM) PASS: Successful DC with 1 AIO-SX subcloud (VDM) PASS: Apply patch before bootstrap on AIO-DX (VDM) Partial-bug: 2056295 Change-Id: I6308a91c1149aca4bef78ed175f8e02d6667944e Signed-off-by: mmachado --- software/software/config.py | 8 ++------ sw-patch/cgcs-patch/cgcs_patch/config.py | 9 ++------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/software/software/config.py b/software/software/config.py index 3cabbb52..ff560415 100644 --- a/software/software/config.py +++ b/software/software/config.py @@ -138,12 +138,8 @@ def get_mgmt_ip(): # the management IP for AIO-SX can be reconfigured during the startup. # Check if /var/run/._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) diff --git a/sw-patch/cgcs-patch/cgcs_patch/config.py b/sw-patch/cgcs-patch/cgcs_patch/config.py index d7f9dc4c..f1c21579 100644 --- a/sw-patch/cgcs-patch/cgcs_patch/config.py +++ b/sw-patch/cgcs-patch/cgcs_patch/config.py @@ -86,13 +86,8 @@ def get_mgmt_ip(): # the management IP for AIO-SX can be reconfigured during the startup. # Check if /var/run/._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)