From 2b25dfa07fedbbe48cc4f92e9ab1933f87101488 Mon Sep 17 00:00:00 2001 From: Vitaly Gridnev Date: Fri, 4 Sep 2015 17:46:55 +0300 Subject: [PATCH] Create ResourceGroup with volumes only if it is required If volumes_per_node or volumes_size is 0, there is no sense in creating empty ResourceGroup. Also remove volumes from one node group in gate to be sure that sahara correctly handle such case. Closes-bug: 1494650 Change-Id: Ic592710773b9338f5857e431b0567bc5c87af2bd --- etc/scenario/gate/fake.yaml.mako | 2 -- sahara/service/heat/templates.py | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/etc/scenario/gate/fake.yaml.mako b/etc/scenario/gate/fake.yaml.mako index 245479d7..655b31b9 100644 --- a/etc/scenario/gate/fake.yaml.mako +++ b/etc/scenario/gate/fake.yaml.mako @@ -18,8 +18,6 @@ clusters: node_processes: - datanode - jobtracker - volumes_per_node: 2 - volumes_size: 1 auto_security_group: true cluster_template: name: fake01 diff --git a/sahara/service/heat/templates.py b/sahara/service/heat/templates.py index a159281e..48446de9 100644 --- a/sahara/service/heat/templates.py +++ b/sahara/service/heat/templates.py @@ -310,7 +310,8 @@ class ClusterStack(object): } }) - resources.update(self._serialize_volume(ng)) + if ng.volumes_per_node > 0 and ng.volumes_size > 0: + resources.update(self._serialize_volume(ng)) return resources