diff options
author | shangxdy <shang.xiaodong@zte.com.cn> | 2016-08-14 02:16:28 +0800 |
---|---|---|
committer | shangxdy <shang.xiaodong@zte.com.cn> | 2016-08-14 23:30:24 +0800 |
commit | 5559b0c06930deb1c7831efe599a1036574f50b3 (patch) | |
tree | eae0c84222cec4a15b1b5ae46656aeb157c01bbe /tosca2heat/tosca-parser/toscaparser/common | |
parent | bfdb0cd484dbabda2488d16536612dfe6d818a18 (diff) |
Add input validation in substitution_mapping class
Add input validation in class of substitution_mapping according to
specification of
http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/
TOSCA-Simple-Profile-YAML-v1.0.html:
1) The properties of substituted node template which be mapped must be
in the inputs of nested service template which defines substutition
mappings;
2) The inputs of nested service template which are not in properties of
the substituted node template must have default values.
3) If the properties of node_type is required and no default value,
must provide inputs for them;
4) Property names and the input names must be the same.
JIRA:PARSER-79
Change-Id: Ie4664fe17c8279ad531ac9acec057f98d4e9281a
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/common')
-rw-r--r-- | tosca2heat/tosca-parser/toscaparser/common/exception.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/common/exception.py b/tosca2heat/tosca-parser/toscaparser/common/exception.py index bd0ed9c..34abe77 100644 --- a/tosca2heat/tosca-parser/toscaparser/common/exception.py +++ b/tosca2heat/tosca-parser/toscaparser/common/exception.py @@ -109,6 +109,16 @@ class UnknownInputError(TOSCAException): msg_fmt = _('Unknown input "%(input_name)s".') +class MissingRequiredInputError(TOSCAException): + msg_fmt = _('%(what)s is missing required input definition ' + ' with name: "%(input_name)s".') + + +class MissingRequiredParameterError(TOSCAException): + msg_fmt = _('%(what)s is missing required parameter for input: ' + '"%(input_name)s".') + + class InvalidPropertyValueError(TOSCAException): msg_fmt = _('Value of property "%(what)s" is invalid.') |