Merge "Removed useless ClusterStack class from heat engine"

This commit is contained in:
Jenkins 2015-07-22 22:57:23 +00:00 committed by Gerrit Code Review
commit 721c1e3636
3 changed files with 8 additions and 13 deletions

View File

@ -187,10 +187,10 @@ class HeatEngine(e.Engine):
True, step=_('Create Heat stack'), param=('cluster', 1))
def _create_instances(self, cluster, target_count, update_stack=False,
disable_rollback=True):
tmpl = ht.ClusterTemplate(cluster)
stack = ht.ClusterStack(cluster)
self._configure_template(tmpl, cluster, target_count)
stack = tmpl.instantiate(update_existing=update_stack,
self._configure_template(stack, cluster, target_count)
stack.instantiate(update_existing=update_stack,
disable_rollback=disable_rollback)
heat.wait_stack_completion(stack.heat_stack)
return self._populate_cluster(cluster, stack)

View File

@ -89,10 +89,11 @@ def _get_volume_name(ng):
}
class ClusterTemplate(object):
class ClusterStack(object):
def __init__(self, cluster):
self.cluster = cluster
self.node_groups_extra = {}
self.heat_stack = None
def add_node_group_extra(self, node_group_id, node_count,
gen_userdata_func):
@ -133,7 +134,7 @@ class ClusterTemplate(object):
b.execute_with_retries(stack.update, **kwargs)
break
return ClusterStack(self, h.get_stack(self.cluster.name))
self.heat_stack = h.get_stack(self.cluster.name)
def _need_aa_server_group(self, node_group):
for node_process in node_group.node_processes:
@ -423,12 +424,6 @@ class ClusterTemplate(object):
}
}
class ClusterStack(object):
def __init__(self, tmpl, heat_stack):
self.tmpl = tmpl
self.heat_stack = heat_stack
def get_node_group_instances(self, node_group):
for output in self.heat_stack.outputs:
if output['output_key'] == node_group.name + "-instances":

View File

@ -50,7 +50,7 @@ class TestClusterTemplate(base.SaharaWithDbTestCase):
anti_affinity=anti_affinity)
def _make_heat_template(self, cluster, ng1, ng2):
heat_template = h.ClusterTemplate(cluster)
heat_template = h.ClusterStack(cluster)
heat_template.add_node_group_extra(ng1['id'], 1,
get_ud_generator('line1\nline2'))
heat_template.add_node_group_extra(ng2['id'], 1,