summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/topology_template.py
diff options
context:
space:
mode:
authorjulien zhang <zhang.jun3g@zte.com.cn>2016-08-15 15:08:34 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-08-15 15:08:34 +0000
commitde4f5e5c4ee8923c8a441c093fb12ddd9fe6fed5 (patch)
treee6f8506c36224cdf590a2eda5ef909299db48c33 /tosca2heat/tosca-parser/toscaparser/topology_template.py
parent769408d0ed336797f76de5df226d30031ae18887 (diff)
parentf52871b8f5ed66924ae8c715788d0bc09c1518ac (diff)
Merge "Add required definition in class of Input."
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/topology_template.py')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/topology_template.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/topology_template.py b/tosca2heat/tosca-parser/toscaparser/topology_template.py
index fe05979..100a06b 100644
--- a/tosca2heat/tosca-parser/toscaparser/topology_template.py
+++ b/tosca2heat/tosca-parser/toscaparser/topology_template.py
@@ -26,7 +26,6 @@ from toscaparser.substitution_mappings import SubstitutionMappings
from toscaparser.tpl_relationship_graph import ToscaGraph
from toscaparser.utils.gettextutils import _
-
# Topology template key names
SECTIONS = (DESCRIPTION, INPUTS, NODE_TEMPLATES,
RELATIONSHIP_TEMPLATES, OUTPUTS, GROUPS,
@@ -73,6 +72,14 @@ class TopologyTemplate(object):
default = input.default
if default:
input.validate(default)
+ if (self.parsed_params and input.name not in self.parsed_params
+ or self.parsed_params is None) and input.required \
+ and input.default is None:
+ exception.ExceptionCollector.appendException(
+ exception.MissingRequiredParameterError(
+ what='Template',
+ input_name=input.name))
+
inputs.append(input)
return inputs