From 54ceb8372605dd621ff3c0cd731ff0b783aba48a Mon Sep 17 00:00:00 2001 From: junfeng-li Date: Fri, 5 Apr 2024 18:06:07 +0000 Subject: [PATCH] Fix swact back after legacy upgrade This commit is to change the swact precheck logic. The new logic will unblock the swact precheck for host state sync state if the USM endpoint is not present. This change is needed for the release that doesn't have USM endpoint present. Test Plan: PASS: swact back to controller 0 after legacy upgrade to 24.09 PaSS: swact between controllers in 24.09 Task: 49826 Story: 2010676 Change-Id: I6824f00589057f4d48c8df04425431cb22361e8e Signed-off-by: junfeng-li --- .../sm-api/sm_api/api/controllers/v1/servicenode.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service-mgmt-api/sm-api/sm_api/api/controllers/v1/servicenode.py b/service-mgmt-api/sm-api/sm_api/api/controllers/v1/servicenode.py index 0d0cb237..680883e2 100755 --- a/service-mgmt-api/sm-api/sm_api/api/controllers/v1/servicenode.py +++ b/service-mgmt-api/sm-api/sm_api/api/controllers/v1/servicenode.py @@ -512,7 +512,9 @@ class ServiceNodeController(rest.RestController): :return: boolean true if all controllers are in sync, false otherwise """ response = self._get_controller_sync_state() - return response["in_sync"] if response else False + # If response is None, we assume USM endpoint is not available + # We don't block the swact operation in this case + return response["in_sync"] if response else True def _lock_pre_check(self, hostname): services = pecan.request.dbapi.sm_service_get_list()