ariatosca-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AviaE <...@git.apache.org>
Subject [GitHub] incubator-ariatosca pull request #189: ARIA-174 Refactor instantiation phase
Date Wed, 09 Aug 2017 10:05:56 GMT
Github user AviaE commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/189#discussion_r132127229
  
    --- Diff: aria/orchestrator/topology/instance_handler.py ---
    @@ -527,78 +539,82 @@ def satisfy_requirements(self):
                        for node in self._model.nodes.values())
     
     
    -class Substitution(common._InstanceHandlerMixin):
    +class Substitution(common.InstanceHandlerBase):
         def coerce(self, **kwargs):
             self._topology.coerce(self._model.mappings, **kwargs)
     
         def validate(self, **kwargs):
    -        self._topology.validate(self._model.mappings)
    +        self._topology.validate(self._model.mappings, **kwargs)
     
         def dump(self, out_stream):
             out_stream.write('Substitution:')
             with out_stream.indent():
    -            out_stream.write('Node type: {0}'.format(out_stream.type(self._model.node_type.name)))
    -            self._topology.dump(self._model.mappings, out_stream, 'Mappings')
    +            out_stream.write('Node type: {0}'.format(out_stream.type_style(
    +                self._model.node_type.name)))
    +            self._topology.dump(self._model.mappings, out_stream, title='Mappings')
     
     
    -class SubstitutionMapping(common._InstanceHandlerMixin):
    +class SubstitutionMapping(common.InstanceHandlerBase):
     
    -    def validate(self, **kwargs):
    +    def coerce(self, **kwargs):
    +        pass
    +
    +    def validate(self, **_):
             if (self._model.capability is None) and (self._model.requirement_template is
None):
                 self._topology.report(
                     'mapping "{0}" refers to neither capability nor a requirement'
                     ' in node: {1}'.format(
    -                    self._model.name, formatting.safe_repr(self._model.node.name)),
    +                    self._model.name, formatting.safe_repr(self._model.node_style.name)),
    --- End diff --
    
    `node_style` should be just `node`.


---
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.
---

Mime
View raw message