Browse Source

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 88a6e3bab5)
Mark Goddard 1 year ago
parent
commit
8cb0e1f570
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      magnum/drivers/heat/driver.py

+ 5
- 0
magnum/drivers/heat/driver.py View File

@@ -74,6 +74,11 @@ class HeatDriver(driver.Driver):
74 74
         raise NotImplementedError("Must implement 'get_template_definition'")
75 75
 
76 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 82
         stack_ctx = mag_ctx.make_cluster_context(cluster)
78 83
         poller = HeatPoller(clients.OpenStackClients(stack_ctx), context,
79 84
                             cluster, self)

Loading…
Cancel
Save