incubator-ariatosca git commit: review fix 2 [Forced Update!]

2017-08-09 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-174-Refactor-instantiation-phase 2a4527c75 -> b7f7ff7a8 
(forced update)


review fix 2


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/b7f7ff7a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/b7f7ff7a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/b7f7ff7a

Branch: refs/heads/ARIA-174-Refactor-instantiation-phase
Commit: b7f7ff7a8809c3154766b0d9c7b65ec78abb62ba
Parents: 1f93729
Author: max-orlov 
Authored: Wed Aug 9 14:52:34 2017 +0300
Committer: max-orlov 
Committed: Wed Aug 9 15:11:10 2017 +0300

--
 aria/core.py   |  6 +++---
 aria/modeling/service_template.py  | 11 --
 aria/modeling/utils.py |  6 +++---
 aria/orchestrator/topology/common.py   |  3 +++
 aria/orchestrator/topology/instance_handler.py |  6 +++---
 aria/orchestrator/topology/template_handler.py | 14 ++--
 aria/orchestrator/topology/topology.py | 24 ++---
 aria/utils/console.py  |  4 
 8 files changed, 34 insertions(+), 40 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b7f7ff7a/aria/core.py
--
diff --git a/aria/core.py b/aria/core.py
index 83d5f7a..9f11dae 100644
--- a/aria/core.py
+++ b/aria/core.py
@@ -76,7 +76,7 @@ class Core(object):
 with storage_session.no_autoflush:
 topology_ = topology.Topology()
 service = topology_.instantiate(
-service_template, inputs=inputs, 
model_storage=self.model_storage)
+service_template, inputs=inputs, 
plugins=self.model_storage.plugin.list())
 topology_.coerce(service, report_issues=True)
 
 topology_.validate(service)
@@ -118,8 +118,8 @@ class Core(object):
 def _parse_service_template(service_template_path):
 context = consumption.ConsumptionContext()
 context.presentation.location = UriLocation(service_template_path)
-# Most of the parser uses the topology package in order to manipulate 
teh models.
-# However, here we use the ConsumerChain, but this should change in 
the future.
+# Most of the parser uses the topology package in order to manipulate 
the models.
+# However, here we use the Consumer, but this should change in the 
future.
 consumption.ConsumerChain(
 context,
 (

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b7f7ff7a/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index aaf88db..d988d21 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -546,10 +546,6 @@ class NodeTemplateBase(TemplateModelMixin):
 extract_property(properties, 'max_instances')
 extract_property(properties, 'default_instances')
 
-def default_property(name, value):
-if name not in scaling:
-scaling[name] = value
-
 # From our scaling capabilities
 for capability_template in self.capability_templates.itervalues():
 if capability_template.type.role == 'scaling':
@@ -562,12 +558,13 @@ class NodeTemplateBase(TemplateModelMixin):
 extract_properties(policy_template.properties)
 
 # Defaults
-default_property('min_instances', 0)
-default_property('max_instances', 1)
-default_property('default_instances', 1)
+scaling.setdefault('min_instances', 0)
+scaling.setdefault('max_instances', 1)
+scaling.setdefault('default_instances', 1)
 
 return scaling
 
+
 class GroupTemplateBase(TemplateModelMixin):
 """
 Template for creating a :class:`Group` instance, which is a typed logical 
container for zero or

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b7f7ff7a/aria/modeling/utils.py
--
diff --git a/aria/modeling/utils.py b/aria/modeling/utils.py
index 9b64598..305020b 100644
--- a/aria/modeling/utils.py
+++ b/aria/modeling/utils.py
@@ -175,7 +175,7 @@ def fix_doc(cls):
 return cls
 
 
-def _get_class_from_sql_relationship(property):
-class_ = property._sa_adapter.owner_state.class_
-prop_name = property._sa_adapter.attr.key
+def _get_class_from_sql_relationship(field):
+class_ = field._sa_adapter.owner_state.class_
+prop_name = field._sa_adapter.attr.key
   

[8/8] incubator-ariatosca git commit: review fix 2

2017-08-09 Thread mxmrlv
review fix 2


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/2a4527c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/2a4527c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/2a4527c7

Branch: refs/heads/ARIA-174-Refactor-instantiation-phase
Commit: 2a4527c75c07fbe2db40dbc486174e27ab1e9fac
Parents: 1f93729
Author: max-orlov 
Authored: Wed Aug 9 14:52:34 2017 +0300
Committer: max-orlov 
Committed: Wed Aug 9 15:06:49 2017 +0300

--
 aria/core.py   |  6 +++---
 aria/modeling/service_template.py  | 11 --
 aria/modeling/utils.py |  6 +++---
 aria/orchestrator/topology/common.py   |  3 +++
 aria/orchestrator/topology/instance_handler.py |  6 +++---
 aria/orchestrator/topology/template_handler.py | 14 ++--
 aria/orchestrator/topology/topology.py | 24 ++---
 aria/utils/console.py  |  4 
 8 files changed, 34 insertions(+), 40 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2a4527c7/aria/core.py
--
diff --git a/aria/core.py b/aria/core.py
index 83d5f7a..5a56cfc 100644
--- a/aria/core.py
+++ b/aria/core.py
@@ -76,7 +76,7 @@ class Core(object):
 with storage_session.no_autoflush:
 topology_ = topology.Topology()
 service = topology_.instantiate(
-service_template, inputs=inputs, 
model_storage=self.model_storage)
+service_template, inputs=inputs, 
model_storage=self.model_storage.plugins.list())
 topology_.coerce(service, report_issues=True)
 
 topology_.validate(service)
@@ -118,8 +118,8 @@ class Core(object):
 def _parse_service_template(service_template_path):
 context = consumption.ConsumptionContext()
 context.presentation.location = UriLocation(service_template_path)
-# Most of the parser uses the topology package in order to manipulate 
teh models.
-# However, here we use the ConsumerChain, but this should change in 
the future.
+# Most of the parser uses the topology package in order to manipulate 
the models.
+# However, here we use the Consumer, but this should change in the 
future.
 consumption.ConsumerChain(
 context,
 (

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2a4527c7/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index aaf88db..d988d21 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -546,10 +546,6 @@ class NodeTemplateBase(TemplateModelMixin):
 extract_property(properties, 'max_instances')
 extract_property(properties, 'default_instances')
 
-def default_property(name, value):
-if name not in scaling:
-scaling[name] = value
-
 # From our scaling capabilities
 for capability_template in self.capability_templates.itervalues():
 if capability_template.type.role == 'scaling':
@@ -562,12 +558,13 @@ class NodeTemplateBase(TemplateModelMixin):
 extract_properties(policy_template.properties)
 
 # Defaults
-default_property('min_instances', 0)
-default_property('max_instances', 1)
-default_property('default_instances', 1)
+scaling.setdefault('min_instances', 0)
+scaling.setdefault('max_instances', 1)
+scaling.setdefault('default_instances', 1)
 
 return scaling
 
+
 class GroupTemplateBase(TemplateModelMixin):
 """
 Template for creating a :class:`Group` instance, which is a typed logical 
container for zero or

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2a4527c7/aria/modeling/utils.py
--
diff --git a/aria/modeling/utils.py b/aria/modeling/utils.py
index 9b64598..305020b 100644
--- a/aria/modeling/utils.py
+++ b/aria/modeling/utils.py
@@ -175,7 +175,7 @@ def fix_doc(cls):
 return cls
 
 
-def _get_class_from_sql_relationship(property):
-class_ = property._sa_adapter.owner_state.class_
-prop_name = property._sa_adapter.attr.key
+def _get_class_from_sql_relationship(field):
+class_ = field._sa_adapter.owner_state.class_
+prop_name = field._sa_adapter.attr.key
 return getattr(class_, prop_name).property.mapper.class_


incubator-ariatosca git commit: review fix 2

2017-08-09 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-174-Refactor-instantiation-phase 0cdec5298 -> 679bc81c5


review fix 2


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/679bc81c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/679bc81c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/679bc81c

Branch: refs/heads/ARIA-174-Refactor-instantiation-phase
Commit: 679bc81c59d781adceb6930f203408c980cf859a
Parents: 0cdec52
Author: max-orlov 
Authored: Wed Aug 9 14:52:34 2017 +0300
Committer: max-orlov 
Committed: Wed Aug 9 14:52:34 2017 +0300

--
 aria/core.py   |  6 +++---
 aria/modeling/service_template.py  | 11 --
 aria/modeling/utils.py |  6 +++---
 aria/orchestrator/topology/common.py   |  3 +++
 aria/orchestrator/topology/instance_handler.py |  6 +++---
 aria/orchestrator/topology/template_handler.py | 16 ++
 aria/orchestrator/topology/topology.py | 24 ++---
 aria/utils/console.py  |  4 
 8 files changed, 35 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/679bc81c/aria/core.py
--
diff --git a/aria/core.py b/aria/core.py
index 83d5f7a..5a56cfc 100644
--- a/aria/core.py
+++ b/aria/core.py
@@ -76,7 +76,7 @@ class Core(object):
 with storage_session.no_autoflush:
 topology_ = topology.Topology()
 service = topology_.instantiate(
-service_template, inputs=inputs, 
model_storage=self.model_storage)
+service_template, inputs=inputs, 
model_storage=self.model_storage.plugins.list())
 topology_.coerce(service, report_issues=True)
 
 topology_.validate(service)
@@ -118,8 +118,8 @@ class Core(object):
 def _parse_service_template(service_template_path):
 context = consumption.ConsumptionContext()
 context.presentation.location = UriLocation(service_template_path)
-# Most of the parser uses the topology package in order to manipulate 
teh models.
-# However, here we use the ConsumerChain, but this should change in 
the future.
+# Most of the parser uses the topology package in order to manipulate 
the models.
+# However, here we use the Consumer, but this should change in the 
future.
 consumption.ConsumerChain(
 context,
 (

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/679bc81c/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index aaf88db..d988d21 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -546,10 +546,6 @@ class NodeTemplateBase(TemplateModelMixin):
 extract_property(properties, 'max_instances')
 extract_property(properties, 'default_instances')
 
-def default_property(name, value):
-if name not in scaling:
-scaling[name] = value
-
 # From our scaling capabilities
 for capability_template in self.capability_templates.itervalues():
 if capability_template.type.role == 'scaling':
@@ -562,12 +558,13 @@ class NodeTemplateBase(TemplateModelMixin):
 extract_properties(policy_template.properties)
 
 # Defaults
-default_property('min_instances', 0)
-default_property('max_instances', 1)
-default_property('default_instances', 1)
+scaling.setdefault('min_instances', 0)
+scaling.setdefault('max_instances', 1)
+scaling.setdefault('default_instances', 1)
 
 return scaling
 
+
 class GroupTemplateBase(TemplateModelMixin):
 """
 Template for creating a :class:`Group` instance, which is a typed logical 
container for zero or

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/679bc81c/aria/modeling/utils.py
--
diff --git a/aria/modeling/utils.py b/aria/modeling/utils.py
index 9b64598..305020b 100644
--- a/aria/modeling/utils.py
+++ b/aria/modeling/utils.py
@@ -175,7 +175,7 @@ def fix_doc(cls):
 return cls
 
 
-def _get_class_from_sql_relationship(property):
-class_ = property._sa_adapter.owner_state.class_
-prop_name = property._sa_adapter.attr.key
+def _get_class_from_sql_relationship(field):
+class_ = field._sa_adapter.owner_state.class_
+prop_name = field._sa_adapter.attr.key