summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHirotaka Wakabayashi <hiwkby@yahoo.com>2022-04-21 03:11:01 +0900
committerHirotaka Wakabayashi <hiwkby@yahoo.com>2022-04-21 03:22:45 +0900
commit47835cf92b78bad9b762687ecfa722e3db1a1e5a (patch)
tree2f1e227d5278323307eeed5a2d78ac85cad902a7
parenta2cab97cc951adbafe10c26a8ebe4f7c8dfd68df (diff)
downloadtrove-47835cf92b78bad9b762687ecfa722e3db1a1e5a.tar.gz
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
-rw-r--r--trove/instance/models.py2
1 files changed, 1 insertions, 1 deletions
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