Fix endpoint status update for secondary and rehome-pending subclouds

The `update_subcloud_endpoint_status_sync` call, when setting the
deploy status of a subcloud to 'secondary' or 'rehome-pending,' is
missing the `subcloud_region` parameter. This omission causes the
endpoints of ALL subclouds to be set to 'unknown.' The `subcloud_name`
parameter alone is insufficient, as it is only used internally in a
log message.

This commit addresses the issue by adding the missing `subcloud_region`
parameter.

Test Plan:
1. PASS - On a system with 2 or more subclouds, update the subcloud
          deploy status to 'secondary' or 'rehome-pending' and verify
          that only the targeted subcloud has its endpoint statuses set
          to 'unknown.' All other subclouds must remain unaffected.

Related commits:
https://review.opendev.org/c/starlingx/distcloud/+/890176
https://review.opendev.org/c/starlingx/distcloud/+/900288

Story: 2010852
Task: 49059

Signed-off-by: Gustavo Herzmann <gustavo.herzmann@windriver.com>
Change-Id: I262bbb70934adb40c9fe9243950bca55039a3ec9
This commit is contained in:
Gustavo Herzmann 2023-11-09 18:22:28 -03:00
parent cd355ca120
commit 64febc50fb
1 changed files with 1 additions and 0 deletions

View File

@ -2857,6 +2857,7 @@ class SubcloudManager(manager.Manager):
self.state_rpc_client.update_subcloud_endpoint_status_sync(
context,
subcloud_name=subcloud.name,
subcloud_region=subcloud.region_name,
endpoint_type=None,
sync_status=dccommon_consts.SYNC_STATUS_UNKNOWN)