ariatosca-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm...@apache.org
Subject [1/2] incubator-ariatosca git commit: removed any remaining consumptioncontext reporting for now, added dynamic model handler resolving and only coerce remains
Date Mon, 24 Jul 2017 15:04:33 GMT
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-174-Refactor-instantiation-phase 8e5fe109d -> 5c92ccad6


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5c92ccad/aria/parser/consumption/consumer.py
----------------------------------------------------------------------
diff --git a/aria/parser/consumption/consumer.py b/aria/parser/consumption/consumer.py
index 4f4c614..4c79aab 100644
--- a/aria/parser/consumption/consumer.py
+++ b/aria/parser/consumption/consumer.py
@@ -13,6 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from aria.orchestrator import topology
+
 
 from ...exceptions import AriaException
 from ...utils.exceptions import print_exception
@@ -27,6 +29,7 @@ class Consumer(object):
     """
 
     def __init__(self, context):
+        self.handler = topology.handler
         self.context = context
 
     def consume(self):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5c92ccad/aria/parser/consumption/modeling.py
----------------------------------------------------------------------
diff --git a/aria/parser/consumption/modeling.py b/aria/parser/consumption/modeling.py
index 34204ca..569b506 100644
--- a/aria/parser/consumption/modeling.py
+++ b/aria/parser/consumption/modeling.py
@@ -13,6 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from aria.orchestrator import topology
+
 from .consumer import Consumer, ConsumerChain
 from ...utils.formatting import json_dumps, yaml_dumps
 from ... import exceptions
@@ -52,7 +54,7 @@ class ValidateServiceTemplate(Consumer):
     """
 
     def consume(self):
-        self.context.modeling.template.validate()
+        self.handler.validate(self.context.modeling.template)
 
 
 class ServiceTemplate(ConsumerChain):
@@ -106,8 +108,6 @@ class InstantiateServiceInstance(Consumer):
             self.context.validation.report('InstantiateServiceInstance consumer: missing
service '
                                            'template')
             return
-        from aria.orchestrator import topology
-
         self.context.modeling.instance = topology.handler.instantiate(
             self.context.modeling.template,
             inputs=dict(self.context.modeling.inputs)
@@ -146,7 +146,7 @@ class ValidateServiceInstance(Consumer):
     """
 
     def consume(self):
-        self.context.modeling.instance.validate()
+        self.handler.validate(self.context.modeling.instance)
 
 
 class SatisfyRequirements(Consumer):
@@ -214,4 +214,5 @@ class ServiceInstance(ConsumerChain):
             raw = self.context.modeling.instance_as_raw
             self.context.write(json_dumps(raw, indent=indent))
         else:
-            self.context.modeling.instance.dump()
+            str_rep = self.handler.dump(self.context.modeling.instance)
+            self.context.write(str_rep)


Mime
View raw message