functional: retrieve cluster to get stack_id

At the moment, if a cluster fails to be created, we fall back to
getting the node information from Heat directly.  However, this
behaviour doesn't work at the moment because `self.cluster` is
a copy of the API record on-create which does not have the stack
ID yet.

This patch makes an extra HTTP request to get the `stack_id` in
order to get the server IPs and be able to pull down the correct
information.

Story: #2002589
Task: #28341
Change-Id: I3fb3542f8ab63f38a23094d579d3df1fcb99a497
This commit is contained in:
Mohammed Naser 2018-12-07 15:15:33 -05:00
parent f27bde7171
commit d6cc77b16f
1 changed files with 2 additions and 1 deletions

View File

@ -369,8 +369,9 @@ extendedKeyUsage = clientAuth
return nodes
def _get_nodes_from_stack(self):
cluster = self.cs.clusters.get(self.cluster.uuid)
nodes = []
stack = self.heat.stacks.get(self.cluster.stack_id)
stack = self.heat.stacks.get(cluster.stack_id)
stack_outputs = stack.to_dict().get('outputs', [])
output_keys = []
if self.cluster_template.coe == "kubernetes":