summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Goddard <mark@stackhpc.com>2017-07-04 19:24:28 +0100
committerRitesh Anand <ritesh.anand@hpe.com>2017-08-17 19:46:31 +0000
commit8cb0e1f57033f697ec43819952ef07b43582b3d1 (patch)
tree5efa0f0551f3d40ee34889e4808a7bb15fc14ff5
parent5fea2788435471e831cc60926ba67bf4b1b8efd9 (diff)
Don't poll heat if no stack exists
Cluster objects are created asynchronously from their underlying heat stacks, meaning that the periodic update can sometimes end up trying to poll a cluster's heat stack before the stack has been created. This change checks whether the stack_id is None and skips polling heat if so. This has the side effect of resolving bug 1682058, since we don't try to use a trust and trustee that do not exist. Change-Id: I73f039659250f1d5b69b23141835c4602c8e019a Closes-Bug: #1682058 (cherry picked from commit 88a6e3bab5f4af92ea4700580af05f5c20ab64f6)
Notes
Notes (review): Code-Review+2: yatin <ykarel@redhat.com> Code-Review+1: Mark Goddard <mark@stackhpc.com> Code-Review+2: Madhuri Kumari <madhuri.kumari@intel.com> Workflow+1: Madhuri Kumari <madhuri.kumari@intel.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Sun, 20 Aug 2017 17:18:55 +0000 Reviewed-on: https://review.openstack.org/494688 Project: openstack/magnum Branch: refs/heads/stable/ocata
-rw-r--r--magnum/drivers/heat/driver.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/magnum/drivers/heat/driver.py b/magnum/drivers/heat/driver.py
index 933e72f..c510a9b 100644
--- a/magnum/drivers/heat/driver.py
+++ b/magnum/drivers/heat/driver.py
@@ -74,6 +74,11 @@ class HeatDriver(driver.Driver):
74 raise NotImplementedError("Must implement 'get_template_definition'") 74 raise NotImplementedError("Must implement 'get_template_definition'")
75 75
76 def update_cluster_status(self, context, cluster): 76 def update_cluster_status(self, context, cluster):
77 if cluster.stack_id is None:
78 # NOTE(mgoddard): During cluster creation it is possible to poll
79 # the cluster before its heat stack has been created. See bug
80 # 1682058.
81 return
77 stack_ctx = mag_ctx.make_cluster_context(cluster) 82 stack_ctx = mag_ctx.make_cluster_context(cluster)
78 poller = HeatPoller(clients.OpenStackClients(stack_ctx), context, 83 poller = HeatPoller(clients.OpenStackClients(stack_ctx), context,
79 cluster, self) 84 cluster, self)