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 <junfeng.li@windriver.com>
This commit is contained in:
junfeng-li 2024-04-05 18:06:07 +00:00
parent fc8b75c6f9
commit 54ceb83726
1 changed files with 3 additions and 1 deletions

View File

@ -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()