summaryrefslogtreecommitdiff
path: root/heat/engine/resource.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-09-18 11:50:08 +0000
committerGerrit Code Review <review@openstack.org>2015-09-18 11:50:08 +0000
commita2f9ca97be4f1dc8341583debfbf445dbb97ff5c (patch)
treefbbeee1e15ea92e13d04cb8f087ec39f9d4c4193 /heat/engine/resource.py
parent6a18429ead2afbcfac1540c318b231945f4c3d00 (diff)
parent99ae1702ffa6abcba909a2fb692b30163bcc8f5b (diff)
downloadheat-a2f9ca97be4f1dc8341583debfbf445dbb97ff5c.tar.gz
Merge "Allow selectively disabling resource validation"
Diffstat (limited to 'heat/engine/resource.py')
-rw-r--r--heat/engine/resource.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/heat/engine/resource.py b/heat/engine/resource.py
index da2293fdb..9e80c190f 100644
--- a/heat/engine/resource.py
+++ b/heat/engine/resource.py
@@ -1080,8 +1080,24 @@ class Resource(object):
return name[0:2] + '-' + name[-postfix_length:]
def validate(self):
+ '''
+ Validate the resource.
+
+ This may be overridden by resource plugins to add extra
+ validation logic specific to the resource implementation.
+ '''
LOG.info(_LI('Validating %s'), six.text_type(self))
+ return self.validate_template()
+ def validate_template(self):
+ '''
+ Validate strucural/syntax aspects of the resource definition.
+
+ Resource plugins should not override this, because this interface
+ is expected to be called pre-create so things normally valid
+ in an overridden validate() such as accessing properties
+ may not work.
+ '''
function.validate(self.t)
self.validate_deletion_policy(self.t.deletion_policy())
self.t.update_policy(self.update_policy_schema,