From 47835cf92b78bad9b762687ecfa722e3db1a1e5a Mon Sep 17 00:00:00 2001 From: Hirotaka Wakabayashi Date: Thu, 21 Apr 2022 03:11:01 +0900 Subject: Don't check task_status when creating a cluster This PR allows load_simple_instance_addresse to get the ipaddr of an instance from neutron when creating a instance belongs to a cluster by skipping checking the task_status. load_simple_instance_addresses, which is a helper function to load ip addr information to Instance instances, currently checks task_status before getting the information from neutron. However, this logic is unnecessary and causes a logic error when instances belong to a cluster because the task_status of creating a cluster is determined after initializing a cluster, which happens in the next phase of load_simple_instance_addresses. The original reason of this code change is that the task status of a mariadb cluster hasn't change from BUILDING to NONE even after successfully creating instances belong to the cluster. Task: 45110 Story: 2009982 Change-Id: Id3234081fd3114e6536358cbdbf94b8280c8bc41 --- trove/instance/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trove/instance/models.py b/trove/instance/models.py index fe424bc8..660f198f 100644 --- a/trove/instance/models.py +++ b/trove/instance/models.py @@ -141,7 +141,7 @@ def load_simple_instance_server_status(context, db_info): def load_simple_instance_addresses(context, db_info): """Get addresses of the instance from Neutron.""" - if 'BUILDING' == db_info.task_status.action: + if 'BUILDING' == db_info.task_status.action and not db_info.cluster_id: db_info.addresses = [] return -- cgit v1.2.1