diff options
author | Steven Hardy <shardy@redhat.com> | 2014-12-12 17:49:10 +0000 |
---|---|---|
committer | Steven Hardy <shardy@redhat.com> | 2014-12-19 11:18:16 +0000 |
commit | 907c0aac79a367d84bdbc26acbf5c4475f9abab7 (patch) | |
tree | ba09384001337d6e98b9ff387ff79f59a1386b66 /heat/engine/resources/resource_group.py | |
parent | 6a22b12e6385c085bdbd5d6922005699ddf69050 (diff) | |
download | heat-907c0aac79a367d84bdbc26acbf5c4475f9abab7.tar.gz |
Disable nested validation for ResourceGroup with zero count
Some users (TripleO specifically) want to disable features via a
count of zero, which is a problem as we always recurse and validate
the nested stack since c31c34f8dfd0919bf46a975701c139073115debc
Instead, we only do validation when the count is non-zero, to
enable, e.g default image names, to be ignored at validation
time (as we'll never use them) instead of rejected by the nested
schema (e.g the server.py properties schema which contains a
custom contraint to always validate the image).
This should still allow us to fail fast (at validation time before
creating anything) when we're actually about to create something,
e.g when the count is non-zero.
Change-Id: I411ff41a9e0730e9864f5ed4ac54f1d5d0ec02d7
Closes-Bug: #1401929
Diffstat (limited to 'heat/engine/resources/resource_group.py')
-rw-r--r-- | heat/engine/resources/resource_group.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/heat/engine/resources/resource_group.py b/heat/engine/resources/resource_group.py index 0136b831b..fdcf7d738 100644 --- a/heat/engine/resources/resource_group.py +++ b/heat/engine/resources/resource_group.py @@ -192,7 +192,11 @@ class ResourceGroup(stack_resource.StackResource): res_class = template_resource.TemplateResource res_inst = res_class("%s:resource_def" % self.name, res_def, self.stack) - res_inst.validate() + # Only validate the resource definition (which may be a + # nested template) if count is non-zero, to enable folks + # to disable features via a zero count if they wish + if self.properties[self.COUNT]: + res_inst.validate() def _name_blacklist(self): """Resolve the remove_policies to names for removal.""" |