Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-48-aria-cli 0d46af2d0 -> 4aa34ffd8


workflow runner now works with service id rather than name


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

Branch: refs/heads/ARIA-48-aria-cli
Commit: 4aa34ffd87e21d8d23c557501686b9fbe7aec791
Parents: 0d46af2
Author: Ran Ziv <[email protected]>
Authored: Tue Apr 4 16:23:13 2017 +0300
Committer: Ran Ziv <[email protected]>
Committed: Tue Apr 4 16:23:13 2017 +0300

----------------------------------------------------------------------
 aria/cli/commands/executions.py      | 3 ++-
 aria/orchestrator/workflow_runner.py | 8 ++++----
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4aa34ffd/aria/cli/commands/executions.py
----------------------------------------------------------------------
diff --git a/aria/cli/commands/executions.py b/aria/cli/commands/executions.py
index 635ae63..cc8bf6c 100644
--- a/aria/cli/commands/executions.py
+++ b/aria/cli/commands/executions.py
@@ -124,10 +124,11 @@ def start(workflow_name,
 
     `WORKFLOW_NAME` is the name of the workflow to execute (e.g. `uninstall`)
     """
+    service = model_storage.service.get_by_name(service_name)
     executor = DryExecutor() if dry else None  # use WorkflowRunner's default 
executor
 
     workflow_runner = \
-        WorkflowRunner(workflow_name, service_name, inputs,
+        WorkflowRunner(workflow_name, service.id, inputs,
                        model_storage, resource_storage, plugin_manager,
                        executor, task_max_attempts, task_retry_interval)
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4aa34ffd/aria/orchestrator/workflow_runner.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflow_runner.py 
b/aria/orchestrator/workflow_runner.py
index cb19ebc..b7a81f4 100644
--- a/aria/orchestrator/workflow_runner.py
+++ b/aria/orchestrator/workflow_runner.py
@@ -38,17 +38,17 @@ WORKFLOW_POLICY_INTERNAL_PROPERTIES = ('implementation', 
'dependencies')
 
 class WorkflowRunner(object):
 
-    def __init__(self, workflow_name, service_name, inputs,
+    def __init__(self, workflow_name, service_id, inputs,
                  model_storage, resource_storage, plugin_manager,
                  executor=None, task_max_attempts=DEFAULT_TASK_MAX_ATTEMPTS,
                  task_retry_interval=DEFAULT_TASK_RETRY_INTERVAL):
 
         self._model_storage = model_storage
         self._workflow_name = workflow_name
-        service = model_storage.service.get_by_name(service_name)
+
         # the IDs are stored rather than the models themselves, so this module 
could be used
         # by several threads without raising errors on model objects shared 
between threads
-        self._service_id = service.id
+        self._service_id = service_id
 
         self._validate_workflow_exists_for_service()
 
@@ -61,7 +61,7 @@ class WorkflowRunner(object):
             name=self.__class__.__name__,
             model_storage=self._model_storage,
             resource_storage=resource_storage,
-            service_id=service.id,
+            service_id=service_id,
             execution_id=execution.id,
             workflow_name=workflow_name,
             task_max_attempts=task_max_attempts,

Reply via email to