from toscaparser.common.exception import InvalidNodeTypeError
from toscaparser.common.exception import MissingRequiredFieldError
from toscaparser.common.exception import UnknownFieldError
-# from toscaparser.common.exception import ValidationError
-# from toscaparser.utils.gettextutils import _
-# from toscaparser.utils import validateutils
-# from toscaparser.nodetemplate import NodeTemplate
-# from toscaparser.elements.nodetype import NodeType
-# from toscaparser.parameters import Input
-# from toscaparser.parameters import Output
-# from toscaparser.groups import Group
-# from toscaparser.policy import Policy
-
log = logging.getLogger('tosca')
-class Substitution_mappings(object):
- '''Substitution_mappings class declaration
+class SubstitutionMappings(object):
+ '''SubstitutionMappings class declaration
Substitution_mappings exports the topology template as an
implementation of a Node type.
for name in inputs_names:
if name not in [input.name for input in self.inputs]:
ExceptionCollector.appendException(
- UnknownFieldError(what='Substitution_mappings',
+ UnknownFieldError(what='SubstitutionMappings',
field=name))
def _validate_capabilities(self):
from toscaparser.parameters import Output
from toscaparser.policy import Policy
from toscaparser.relationship_template import RelationshipTemplate
-from toscaparser.substitution_mappings import Substitution_mappings
+from toscaparser.substitution_mappings import SubstitutionMappings
from toscaparser.tpl_relationship_graph import ToscaGraph
from toscaparser.utils.gettextutils import _
def _substitution_mappings(self):
tpl_substitution_mapping = self._tpl_substitution_mappings()
if tpl_substitution_mapping:
- return Substitution_mappings(tpl_substitution_mapping,
- self.nodetemplates,
- self.inputs,
- self.outputs,
- self.sub_mapped_node_template,
- self.custom_defs)
+ return SubstitutionMappings(tpl_substitution_mapping,
+ self.nodetemplates,
+ self.inputs,
+ self.outputs,
+ self.sub_mapped_node_template,
+ self.custom_defs)
def _policies(self):
policies = []
def get_sub_mapping_node_type(cls, topology_tpl):
if topology_tpl and isinstance(topology_tpl, dict):
submap_tpl = topology_tpl.get(SUBSTITUION_MAPPINGS)
- return Substitution_mappings.get_node_type(submap_tpl)
+ return SubstitutionMappings.get_node_type(submap_tpl)