ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm...@apache.org
Subject incubator-ariatosca git commit: misc_fixes_for_os_plugin [Forced Update!]
Date Mon, 17 Apr 2017 15:59:46 GMT
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/misc_fixes_for_os_plugin bc67b6ae4 -> be8ffc2ec (forced update)


misc_fixes_for_os_plugin


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

Branch: refs/heads/misc_fixes_for_os_plugin
Commit: be8ffc2ec177c1e3e83e2cbb62d08864b7a9b410
Parents: e23f5df
Author: max-orlov <maxim@gigaspaces.com>
Authored: Sun Apr 16 23:08:02 2017 +0300
Committer: max-orlov <maxim@gigaspaces.com>
Committed: Mon Apr 17 18:59:37 2017 +0300

----------------------------------------------------------------------
 aria/core.py                                    | 22 +++++++++------
 aria/modeling/service_template.py               |  2 +-
 .../execution_plugin/ssh/operations.py          |  8 +++++-
 aria/orchestrator/plugin.py                     |  1 +
 aria/orchestrator/workflows/builtin/utils.py    | 28 ++++++++++----------
 aria/orchestrator/workflows/executor/process.py |  4 +--
 aria/parser/consumption/__init__.py             |  7 +++--
 7 files changed, 43 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/be8ffc2e/aria/core.py
----------------------------------------------------------------------
diff --git a/aria/core.py b/aria/core.py
index 365f39c..d0e8ef4 100644
--- a/aria/core.py
+++ b/aria/core.py
@@ -75,14 +75,20 @@ class Core(object):
             service = service_template.instantiate(None, self.model_storage, inputs=inputs)
 
         self.model_storage._all_api_kwargs['session'].flush()
-        consumption.ConsumerChain(
-            context,
-            (
-                consumption.FindHosts,
-                consumption.ConfigureOperations
-            )).consume()
-        if context.validation.dump_issues():
-            raise exceptions.InstantiationError('Failed to instantiate service template')
+
+        with self.model_storage._all_api_kwargs['session'].no_autoflush:
+            # TODO: try this one as well
+            # consumption.ServiceInstance(context).consume()
+            consumption.ConsumerChain(
+                context,
+                (
+                    consumption.SatisfyRequirements,
+                    consumption.ValidateCapabilities,
+                    consumption.FindHosts,
+                    consumption.ConfigureOperations
+                )).consume()
+            if context.validation.dump_issues():
+                raise exceptions.InstantiationError('Failed to instantiate service template')
 
         # If the user didn't enter a name for this service, we'll want to auto generate it.
         # But how will we ensure a unique but simple name? We'll append the services' unique
id

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/be8ffc2e/aria/modeling/service_template.py
----------------------------------------------------------------------
diff --git a/aria/modeling/service_template.py b/aria/modeling/service_template.py
index 9a07b53..14390fb 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -1237,7 +1237,7 @@ class RequirementTemplateBase(TemplateModelMixin):
 
         # Find first node that matches the type
         elif self.target_node_type is not None:
-            for target_node_template in context.modeling.template.node_templates.itervalues():
+            for target_node_template in self.node_template.service_template.node_templates.values():
                 if self.target_node_type.get_descendant(target_node_template.type.name) is
None:
                     continue
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/be8ffc2e/aria/orchestrator/execution_plugin/ssh/operations.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/execution_plugin/ssh/operations.py b/aria/orchestrator/execution_plugin/ssh/operations.py
index 7147a30..4ad5bfd 100644
--- a/aria/orchestrator/execution_plugin/ssh/operations.py
+++ b/aria/orchestrator/execution_plugin/ssh/operations.py
@@ -130,7 +130,9 @@ def _patch_ctx(ctx):
 
 def _hide_output(ctx, groups):
     """ Hides Fabric's output for every 'entity' in `groups` """
-    groups = set(groups or [])
+    # TODO: restore.
+    # groups = set(groups or groups)
+    groups = set(['everything'])
     if not groups.issubset(constants.VALID_FABRIC_GROUPS):
         ctx.task.abort('`hide_output` must be a subset of {0} (Provided: {1})'
                        .format(', '.join(constants.VALID_FABRIC_GROUPS), ', '.join(groups)))
@@ -144,6 +146,10 @@ def _fabric_env(ctx, fabric_env, warn_only):
     env.update(fabric_env or {})
     env.setdefault('warn_only', warn_only)
     # validations
+
+    # TODO: this a silly fix, we need intrinsic functions for this to work properly
+    env['host_string'] = ctx.model.node_template.get_by_name('virtual_ip').nodes[0].runtime_properties['floating_ip_address']
+
     if (not env.get('host_string')) and (ctx.task) and (ctx.task.actor) and (ctx.task.actor.host):
         env['host_string'] = ctx.task.actor.host.host_address
     if not env.get('host_string'):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/be8ffc2e/aria/orchestrator/plugin.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/plugin.py b/aria/orchestrator/plugin.py
index d526e9c..2dabe67 100644
--- a/aria/orchestrator/plugin.py
+++ b/aria/orchestrator/plugin.py
@@ -43,6 +43,7 @@ class PluginManager(object):
         os_props = metadata['build_server_os_properties']
 
         plugin = cls(
+            name=metadata['package_name'],
             archive_name=metadata['archive_name'],
             supported_platform=metadata['supported_platform'],
             supported_py_versions=metadata['supported_python_versions'],

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/be8ffc2e/aria/orchestrator/workflows/builtin/utils.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/builtin/utils.py b/aria/orchestrator/workflows/builtin/utils.py
index 722c618..2254d13 100644
--- a/aria/orchestrator/workflows/builtin/utils.py
+++ b/aria/orchestrator/workflows/builtin/utils.py
@@ -73,13 +73,13 @@ def relationship_tasks(relationship, interface_name, source_operation_name=None,
         try:
             if _is_empty_task(relationship, interface_name, source_operation_name):
                 operations.append(StubTask())
-
-            operations.append(
-                OperationTask.for_relationship(relationship=relationship,
-                                               interface_name=interface_name,
-                                               operation_name=source_operation_name,
-                                               **kwargs)
-            )
+            else:
+                operations.append(
+                    OperationTask.for_relationship(relationship=relationship,
+                                                   interface_name=interface_name,
+                                                   operation_name=source_operation_name,
+                                                   **kwargs)
+                )
         except exceptions.OperationNotFoundException:
             # We will skip relationships which do not have the operation
             pass
@@ -87,13 +87,13 @@ def relationship_tasks(relationship, interface_name, source_operation_name=None,
         try:
             if _is_empty_task(relationship, interface_name, target_operation_name):
                 operations.append(StubTask())
-
-            operations.append(
-                OperationTask.for_relationship(relationship=relationship,
-                                               interface_name=interface_name,
-                                               operation_name=target_operation_name,
-                                               **kwargs)
-            )
+            else:
+                operations.append(
+                    OperationTask.for_relationship(relationship=relationship,
+                                                   interface_name=interface_name,
+                                                   operation_name=target_operation_name,
+                                                   **kwargs)
+                )
         except exceptions.OperationNotFoundException:
             # We will skip relationships which do not have the operation
             pass

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/be8ffc2e/aria/orchestrator/workflows/executor/process.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/executor/process.py b/aria/orchestrator/workflows/executor/process.py
index 298d7b5..aea9c76 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -383,14 +383,12 @@ def _main():
 
     implementation = arguments['implementation']
     operation_inputs = arguments['operation_inputs']
-    import pydevd; pydevd.settrace('localhost', suspend=False)
-    operation_inputs = dict((k, v.value) for k, v in operation_inputs.items())
     context_dict = arguments['context']
 
     # This is required for the instrumentation work properly.
     # See docstring of `remove_mutable_association_listener` for further details
     modeling_types.remove_mutable_association_listener()
-    import pydevd; pydevd.settrace('localhost', suspend=False)
+
     with instrumentation.track_changes() as instrument:
         try:
             ctx = context_dict['context_cls'].deserialize_from_dict(**context_dict['context'])

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/be8ffc2e/aria/parser/consumption/__init__.py
----------------------------------------------------------------------
diff --git a/aria/parser/consumption/__init__.py b/aria/parser/consumption/__init__.py
index ff1b376..0eec638 100644
--- a/aria/parser/consumption/__init__.py
+++ b/aria/parser/consumption/__init__.py
@@ -20,7 +20,7 @@ from .style import Style
 from .consumer import Consumer, ConsumerChain
 from .presentation import Read
 from .validation import Validate
-from .modeling import ServiceTemplate, Types, ServiceInstance, FindHosts, ConfigureOperations
+from .modeling import ServiceTemplate, Types, ServiceInstance, FindHosts, ConfigureOperations,
SatisfyRequirements, ValidateCapabilities
 from .inputs import Inputs
 
 __all__ = (
@@ -34,4 +34,7 @@ __all__ = (
     'ServiceTemplate',
     'Types',
     'ServiceInstance',
-    'Inputs')
+    'Inputs',
+    'SatisfyRequirements',
+    'ValidateCapabilities'
+)


Mime
View raw message