示例#1
0
 def _get_import_locations(self, context):
     import_locations = super(ToscaSimpleNfvPresenter1_0,
                              self)._get_import_locations(context)
     if context.presentation.import_profile:
         return FrozenList([self.SIMPLE_PROFILE_FOR_NFV_LOCATION] +
                           import_locations)
     return import_locations
示例#2
0
 def _get_import_locations(self, context):
     import_locations = []
     if context.presentation.import_profile:
         import_locations.append(self.SIMPLE_PROFILE_LOCATION)
     imports = self._get('service_template', 'imports')
     if imports:
         import_locations += [self.SPECIAL_IMPORTS.get(i.file, i.file) for i in imports]
     return FrozenList(import_locations) if import_locations else EMPTY_READ_ONLY_LIST
示例#3
0
 def _get_import_locations(self, context):
     import_locations = []
     if context.presentation.import_profile:
         import_locations += (self.SIMPLE_PROFILE_LOCATION,
                              self.SIMPLE_PROFILE_FOR_NFV_LOCATION)
     imports = self._get('service_template', 'imports')
     if imports:
         import_locations += [i.file for i in imports]
     return FrozenList(
         import_locations) if import_locations else EMPTY_READ_ONLY_LIST
示例#4
0
    def __init__(self, context, presentation, argument):
        self.locator = presentation._locator

        if not isinstance(argument, list):
            raise InvalidValueError(
                'function "concat" argument must be a list of string expressions: {0}'
                .format(safe_repr(argument)),
                locator=self.locator)

        string_expressions = []
        for index, an_argument in enumerate(argument):
            string_expressions.append(parse_string_expression(context, presentation, 'concat',
                                                              index, None, an_argument))
        self.string_expressions = FrozenList(string_expressions)
示例#5
0
 def _get_import_locations(self, context):
     import_locations = []
     if context.presentation.configuration.get('tosca.import_profile',
                                               True):
         import_locations.append(self.SIMPLE_PROFILE_LOCATION)
     imports = self._get('service_template', 'imports')
     if imports:
         for i in imports:
             if i.repository == self.PLUGIN_REPOSITORY:
                 #Add plugin.yaml from plugin resource storage to import locations
                 import_locations += [i.file + self.PLUGIN_IMPORT_FILE]
             else:
                 import_locations += [
                     self.SPECIAL_IMPORTS.get(i.file, i.file)
                 ]
     return FrozenList(
         import_locations) if import_locations else EMPTY_READ_ONLY_LIST
示例#6
0
 def _get_targets(self, context):
     node_templates, groups = get_policy_targets(context, self)
     return FrozenList(node_templates), FrozenList(groups)
示例#7
0
 def _get_requirements(self, context):
     return FrozenList(get_template_requirements(context, self))
示例#8
0
 def _get_targets(self, context):
     node_types, group_types = get_inherited_targets(context, self)
     return FrozenList(node_types), FrozenList(group_types)
示例#9
0
 def _get_requirements(self, context):
     return FrozenList(get_inherited_requirement_definitions(context, self))
示例#10
0
文件: types.py 项目: vnigam1985/tosca
 def _get_members(self, context):
     node_types = get_inherited_members(context, self)
     return FrozenList(node_types)