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, 02 Aug 2017 18:11:23 GMT
Github user AviaE commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/189#discussion_r130894358
  
    --- Diff: aria/orchestrator/topology/instance_handler.py ---
    @@ -0,0 +1,644 @@
    +# Licensed to the Apache Software Foundation (ASF) under one or more
    +# contributor license agreements.  See the NOTICE file distributed with
    +# this work for additional information regarding copyright ownership.
    +# The ASF licenses this file to You under the Apache License, Version 2.0
    +# (the "License"); you may not use this file except in compliance with
    +# the License.  You may obtain a copy of the License at
    +#
    +#     http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
    +
    +from ... parser.modeling import context
    +from ... modeling import models
    +from ... utils import formatting
    +from .. import execution_plugin
    +from .. import decorators
    +from . import common
    +
    +
    +class Artifact(common._InstanceHandlerMixin):
    +
    +    def coerce(self, **kwargs):
    +        self._topology.coerce(self._model.properties, **kwargs)
    +
    +    def validate(self, **kwargs):
    +        self._topology.validate(self._model.properties)
    +
    +    def dump(self, out_stream):
    +        with out_stream.indent():
    +            out_stream.write(out_stream.node(self._model.name))
    +            out_stream.write(out_stream.meta(self._model.description))
    +            with out_stream.indent():
    +                out_stream.write('Artifact type: {0}'.format(out_stream.type(
    +                    self._model.type.name)))
    +                out_stream.write('Source path: {0}'.format(
    +                    out_stream.literal(self._model.source_path)))
    +                if self._model.target_path is not None:
    --- End diff --
    
    Are those `if`s necessary? Isn't the `write` method smart enough to handle the empty model
case?


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