Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A09F9200C7E for ; Tue, 23 May 2017 16:41:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9F2AB160BC3; Tue, 23 May 2017 14:41:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E4AB0160BB6 for ; Tue, 23 May 2017 16:41:45 +0200 (CEST) Received: (qmail 23956 invoked by uid 500); 23 May 2017 14:41:45 -0000 Mailing-List: contact commits-help@ariatosca.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ariatosca.incubator.apache.org Delivered-To: mailing list commits@ariatosca.incubator.apache.org Received: (qmail 23946 invoked by uid 99); 23 May 2017 14:41:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 May 2017 14:41:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F3296DFF9F; Tue, 23 May 2017 14:41:44 +0000 (UTC) From: ran-z To: commits@ariatosca.apache.org Reply-To: commits@ariatosca.apache.org References: In-Reply-To: Subject: [GitHub] incubator-ariatosca pull request #138: ARIA-149 Enhance operation configurat... Content-Type: text/plain Message-Id: <20170523144144.F3296DFF9F@git1-us-west.apache.org> Date: Tue, 23 May 2017 14:41:44 +0000 (UTC) archived-at: Tue, 23 May 2017 14:41:46 -0000 Github user ran-z commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/138#discussion_r118011107 --- Diff: aria/modeling/service_instance.py --- @@ -1728,34 +1732,41 @@ def operation_template(cls): def inputs(cls): return relationship.many_to_many(cls, 'parameter', prefix='inputs', dict_key='name') + @declared_attr + def configuration(cls): + return relationship.many_to_many(cls, 'parameter', prefix='configuration', dict_key='name') + + @declared_attr + def arguments(cls): + return relationship.many_to_many(cls, 'parameter', prefix='arguments', dict_key='name') + # endregion description = Column(Text) relationship_edge = Column(Boolean) implementation = Column(Text) - configuration = Column(modeling_types.StrictDict(key_cls=basestring)) dependencies = Column(modeling_types.StrictList(item_cls=basestring)) + function = Column(Text) executor = Column(Text) max_attempts = Column(Integer) retry_interval = Column(Integer) def configure(self): - from . import models - # Note: for workflows (operations attached directly to the service) "interface" will be None - if (self.implementation is None) or (self.interface is None): + if (self.implementation is None) and (self.function is None): return - if self.plugin is None: - arguments = execution_plugin.instantiation.configure_operation(self) + if (self.plugin is None) and (self.interface is not None): + # Default to execution plugin ("interface" is None for workflow operations) + execution_plugin.instantiation.configure_operation(self) else: # In the future plugins may be able to add their own "configure_operation" hook that - # can validate the configuration and otherwise return specially derived arguments - arguments = self.configuration + # can validate the configuration and otherwise create specially derived arguments. For + # now, we just send all configuration parameters as arguments + utils.instantiate_dict(self, self.arguments, self.configuration) - # Note: the arguments will *override* operation inputs of the same name - if arguments: - for k, v in arguments.iteritems(): - self.inputs[k] = models.Parameter.wrap(k, v) --- End diff -- why remove this? --- 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---