ariatosca-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxmrlv <...@git.apache.org>
Subject [GitHub] incubator-ariatosca pull request #189: ARIA-174 Refactor instantiation phase
Date Mon, 31 Jul 2017 11:47:22 GMT
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/189#discussion_r130331038
  
    --- Diff: aria/core.py ---
    @@ -67,31 +68,26 @@ def delete_service_template(self, service_template_id):
             self.resource_storage.service_template.delete(entry_id=str(service_template.id))
     
         def create_service(self, service_template_id, inputs, service_name=None):
    -
             service_template = self.model_storage.service_template.get(service_template_id)
     
    -        # creating an empty ConsumptionContext, initiating a threadlocal context
    -        context = consumption.ConsumptionContext()
    -
             storage_session = self.model_storage._all_api_kwargs['session']
             # setting no autoflush for the duration of instantiation - this helps avoid dependency
             # constraints as they're being set up
             with storage_session.no_autoflush:
    -            service = service_template.instantiate(None, self.model_storage, inputs=inputs)
    -
    -            consumption.ConsumerChain(
    -                context,
    -                (
    -                    consumption.CoerceServiceInstanceValues,
    -                    consumption.ValidateServiceInstance,
    -                    consumption.SatisfyRequirements,
    -                    consumption.CoerceServiceInstanceValues,
    -                    consumption.ValidateCapabilities,
    -                    consumption.FindHosts,
    -                    consumption.ConfigureOperations,
    -                    consumption.CoerceServiceInstanceValues
    -                )).consume()
    -            if context.validation.dump_issues():
    +            topology = Topology(self.model_storage)
    +            service = topology.instantiate(service_template, inputs=inputs)
    +            topology.coerce(service)
    +
    +            topology.validate(service)
    +            topology.satisfy_requirements(service)
    +            topology.coerce(service)
    +
    +            topology.validate_capabilities(service)
    +            topology.find_hosts(service)
    +            topology.configure_operations(service)
    --- End diff --
    
    is it possible to couple the configure operations with the creation of service?


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