From 5b4266f393fbe6a88b06fca4dd776cdfdbb12c91 Mon Sep 17 00:00:00 2001 From: Heitor Matsui Date: Mon, 10 Jun 2024 17:55:04 +0000 Subject: [PATCH] Revert "expand sw_patch config check to other deploy types" This reverts commit c9d1a9f8c63a1ddea170fd2ccef576eabecda9e1. Reason for revert: This commit is impacting USM on non-controller nodes in multi-node deployments (standard and storage) and according to the owner of this commit, this change is not needed and does not fix the issue it was intended to fix. Change-Id: I74ce9e316a1d0806bdc32710e486fcba05538f90 --- software/software/config.py | 8 ++++++-- sw-patch/cgcs-patch/cgcs_patch/config.py | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/software/software/config.py b/software/software/config.py index ff560415..3cabbb52 100644 --- a/software/software/config.py +++ b/software/software/config.py @@ -138,8 +138,12 @@ 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 - if not os.path.exists(tsc.VOLATILE_CONTROLLER_CONFIG_COMPLETE): - return None + 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") 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 f1c21579..d7f9dc4c 100644 --- a/sw-patch/cgcs-patch/cgcs_patch/config.py +++ b/sw-patch/cgcs-patch/cgcs_patch/config.py @@ -86,8 +86,13 @@ 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 - if not os.path.exists(tsc.VOLATILE_CONTROLLER_CONFIG_COMPLETE): - return None + 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") + mgmt_hostname = socket.gethostname() return utils.gethostbyname(mgmt_hostname)