Github user ran-z commented on a diff in the pull request:
https://github.com/apache/incubator-ariatosca/pull/95#discussion_r111164451
--- Diff: extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py
---
@@ -352,20 +359,44 @@ def create_interface_template_model(context,
service_template, interface):
return model if model.operation_templates else None
-def create_operation_template_model(context, service_template, operation):
# pylint: disable=unused-argument
+def create_operation_template_model(context, service_template, operation):
model = OperationTemplate(name=operation._name)
if operation.description:
model.description = operation.description.value
implementation = operation.implementation
- if (implementation is not None) and operation.implementation.primary:
- model.plugin_specification, model.implementation = \
- parse_implementation_string(context, service_template,
operation.implementation.primary)
-
+ if implementation is not None:
+ primary = implementation.primary
+ plugin_name, model.implementation = split_prefix(primary)
+ if plugin_name is not None:
+ model.plugin_specification =
service_template.plugin_specifications.get(plugin_name)
+ if model.plugin_specification is None:
+ context.validation.report(
+ 'unknown plugin "%s" specified in operation
implementation: %s'
+ % (plugin_name, primary),
+ locator=operation._get_child_locator('implementation',
'primary'),
+ level=Issue.BETWEEN_TYPES)
+
+ relationship_edge =
operation._get_extensions(context).get('relationship_edge')
+ if relationship_edge is not None:
--- End diff --
what if it is None? where do we set the default? I think either we don't or
I've missed it :)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---