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

2016-12-05 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-30-SQL-based-storage-implementation e1441f90a -> 9d7431bd2 
(forced update)


code review 2 - wip


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

Branch: refs/heads/ARIA-30-SQL-based-storage-implementation
Commit: 9d7431bd2d462a310c4413b202e8c0b987862c6c
Parents: 5ea0b63
Author: mxmrlv 
Authored: Sun Dec 4 18:56:02 2016 +0200
Committer: mxmrlv 
Committed: Mon Dec 5 15:10:50 2016 +0200

--
 aria/__init__.py|   4 +-
 aria/orchestrator/context/common.py |  14 +-
 aria/orchestrator/context/operation.py  |   4 +-
 aria/orchestrator/context/toolbelt.py   |   7 +-
 aria/orchestrator/context/workflow.py   |  18 +-
 aria/orchestrator/workflows/core/task.py|  17 +-
 aria/storage/api.py |  28 ---
 aria/storage/core.py|   8 +-
 aria/storage/filesystem_rapi.py |  24 ++
 aria/storage/models.py  | 246 +--
 aria/storage/sql_mapi.py|  68 +++--
 aria/storage/structures.py  |  41 +---
 tests/mock/context.py   |  15 +-
 tests/mock/models.py|  73 +++---
 tests/orchestrator/context/test_operation.py|  22 +-
 tests/orchestrator/context/test_toolbelt.py |  30 ++-
 tests/orchestrator/context/test_workflow.py |  22 +-
 tests/orchestrator/workflows/api/test_task.py   |  15 +-
 .../orchestrator/workflows/builtin/__init__.py  |   2 -
 .../workflows/builtin/test_execute_operation.py |  22 +-
 .../orchestrator/workflows/builtin/test_heal.py |  27 +-
 .../workflows/builtin/test_install.py   |  11 +-
 .../workflows/builtin/test_uninstall.py |  12 +-
 .../orchestrator/workflows/core/test_engine.py  |   5 +-
 tests/orchestrator/workflows/core/test_task.py  |  11 +-
 .../test_task_graph_into_exececution_graph.py   |   3 +-
 tests/storage/__init__.py   |   4 +-
 tests/storage/test_model_storage.py |  37 +--
 tests/storage/test_models.py|  37 ++-
 tests/storage/test_resource_storage.py  |   6 +-
 30 files changed, 423 insertions(+), 410 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9d7431bd/aria/__init__.py
--
diff --git a/aria/__init__.py b/aria/__init__.py
index 5317afa..f5151e3 100644
--- a/aria/__init__.py
+++ b/aria/__init__.py
@@ -56,7 +56,7 @@ def install_aria_extensions():
 del sys.modules[module_name]
 
 
-def application_model_storage(api, api_params=None):
+def application_model_storage(api, api_kwargs=None):
 """
 Initiate model storage for the supplied storage driver
 """
@@ -76,7 +76,7 @@ def application_model_storage(api, api_params=None):
 storage.models.Task,
 ]
 # if api not in _model_storage:
-return storage.ModelStorage(api, items=models, api_params=api_params or {})
+return storage.ModelStorage(api, items=models, api_kwargs=api_kwargs or {})
 
 
 def application_resource_storage(driver):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9d7431bd/aria/orchestrator/context/common.py
--
diff --git a/aria/orchestrator/context/common.py 
b/aria/orchestrator/context/common.py
index a4cc4a4..75bb0fb 100644
--- a/aria/orchestrator/context/common.py
+++ b/aria/orchestrator/context/common.py
@@ -32,8 +32,8 @@ class BaseContext(logger.LoggerMixin):
 model_storage,
 resource_storage,
 deployment_id,
-workflow_id,
-execution_id=None,
+workflow_name,
+execution_name=None,
 task_max_attempts=1,
 task_retry_interval=0,
 task_ignore_failure=False,
@@ -44,8 +44,8 @@ class BaseContext(logger.LoggerMixin):
 self._model = model_storage
 self._resource = resource_storage
 self._deployment_id = deployment_id
-self._workflow_id = workflow_id
-self._execution_id = execution_id or str(uuid4())
+self._workflow_name = workflow_name
+self._execution_name = execution_name or str(uuid4())
 self._task_max_attempts = task_max_attempts
 self._task_retry_interval = task_retry_interval
 self._task_ignore_failure = task_ignore_failure
@@ -54,8 +54,8 @@ class BaseContext(logger.LoggerMixin):
 ret

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

2016-12-05 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-30-SQL-based-storage-implementation 9d7431bd2 -> 72a4e48c8 
(forced update)


code review 2 - wip


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

Branch: refs/heads/ARIA-30-SQL-based-storage-implementation
Commit: 72a4e48c8f0ae74f2518f17192f001732a206bb2
Parents: 5ea0b63
Author: mxmrlv 
Authored: Sun Dec 4 18:56:02 2016 +0200
Committer: mxmrlv 
Committed: Mon Dec 5 15:11:24 2016 +0200

--
 aria/__init__.py|   4 +-
 aria/orchestrator/context/common.py |  14 +-
 aria/orchestrator/context/operation.py  |   4 +-
 aria/orchestrator/context/toolbelt.py   |   7 +-
 aria/orchestrator/context/workflow.py   |  18 +-
 aria/orchestrator/workflows/core/task.py|  17 +-
 aria/storage/api.py |  31 ---
 aria/storage/core.py|   8 +-
 aria/storage/filesystem_rapi.py |  24 ++
 aria/storage/models.py  | 246 +--
 aria/storage/sql_mapi.py|  68 +++--
 aria/storage/structures.py  |  41 +---
 tests/mock/context.py   |  15 +-
 tests/mock/models.py|  73 +++---
 tests/orchestrator/context/test_operation.py|  22 +-
 tests/orchestrator/context/test_toolbelt.py |  30 ++-
 tests/orchestrator/context/test_workflow.py |  22 +-
 tests/orchestrator/workflows/api/test_task.py   |  15 +-
 .../orchestrator/workflows/builtin/__init__.py  |   2 -
 .../workflows/builtin/test_execute_operation.py |  22 +-
 .../orchestrator/workflows/builtin/test_heal.py |  27 +-
 .../workflows/builtin/test_install.py   |  11 +-
 .../workflows/builtin/test_uninstall.py |  12 +-
 .../orchestrator/workflows/core/test_engine.py  |   5 +-
 tests/orchestrator/workflows/core/test_task.py  |  11 +-
 .../test_task_graph_into_exececution_graph.py   |   3 +-
 tests/storage/__init__.py   |   4 +-
 tests/storage/test_model_storage.py |  37 +--
 tests/storage/test_models.py|  37 ++-
 tests/storage/test_resource_storage.py  |   6 +-
 30 files changed, 423 insertions(+), 413 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/72a4e48c/aria/__init__.py
--
diff --git a/aria/__init__.py b/aria/__init__.py
index 5317afa..f5151e3 100644
--- a/aria/__init__.py
+++ b/aria/__init__.py
@@ -56,7 +56,7 @@ def install_aria_extensions():
 del sys.modules[module_name]
 
 
-def application_model_storage(api, api_params=None):
+def application_model_storage(api, api_kwargs=None):
 """
 Initiate model storage for the supplied storage driver
 """
@@ -76,7 +76,7 @@ def application_model_storage(api, api_params=None):
 storage.models.Task,
 ]
 # if api not in _model_storage:
-return storage.ModelStorage(api, items=models, api_params=api_params or {})
+return storage.ModelStorage(api, items=models, api_kwargs=api_kwargs or {})
 
 
 def application_resource_storage(driver):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/72a4e48c/aria/orchestrator/context/common.py
--
diff --git a/aria/orchestrator/context/common.py 
b/aria/orchestrator/context/common.py
index a4cc4a4..75bb0fb 100644
--- a/aria/orchestrator/context/common.py
+++ b/aria/orchestrator/context/common.py
@@ -32,8 +32,8 @@ class BaseContext(logger.LoggerMixin):
 model_storage,
 resource_storage,
 deployment_id,
-workflow_id,
-execution_id=None,
+workflow_name,
+execution_name=None,
 task_max_attempts=1,
 task_retry_interval=0,
 task_ignore_failure=False,
@@ -44,8 +44,8 @@ class BaseContext(logger.LoggerMixin):
 self._model = model_storage
 self._resource = resource_storage
 self._deployment_id = deployment_id
-self._workflow_id = workflow_id
-self._execution_id = execution_id or str(uuid4())
+self._workflow_name = workflow_name
+self._execution_name = execution_name or str(uuid4())
 self._task_max_attempts = task_max_attempts
 self._task_retry_interval = task_retry_interval
 self._task_ignore_failure = task_ignore_failure
@@ -54,8 +54,8 @@ class BaseContext(logger.LoggerMixin):
 ret

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

2016-12-05 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-30-SQL-based-storage-implementation b60199ba5 -> e1441f90a 
(forced update)


code review 2 - wip


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

Branch: refs/heads/ARIA-30-SQL-based-storage-implementation
Commit: e1441f90a9d6500f0780c293363b13b7dd66cf11
Parents: 5ea0b63
Author: mxmrlv 
Authored: Sun Dec 4 18:56:02 2016 +0200
Committer: mxmrlv 
Committed: Mon Dec 5 15:07:24 2016 +0200

--
 aria/__init__.py|   4 +-
 aria/orchestrator/context/common.py |  14 +-
 aria/orchestrator/context/operation.py  |   4 +-
 aria/orchestrator/context/toolbelt.py   |   7 +-
 aria/orchestrator/context/workflow.py   |  18 +-
 aria/orchestrator/workflows/core/task.py|  17 +-
 aria/storage/core.py|   8 +-
 aria/storage/models.py  | 246 +--
 aria/storage/sql_mapi.py|  68 +++--
 aria/storage/structures.py  |  41 +---
 tests/mock/context.py   |  15 +-
 tests/mock/models.py|  73 +++---
 tests/orchestrator/context/test_operation.py|  22 +-
 tests/orchestrator/context/test_toolbelt.py |  30 ++-
 tests/orchestrator/context/test_workflow.py |  22 +-
 tests/orchestrator/workflows/api/test_task.py   |  15 +-
 .../orchestrator/workflows/builtin/__init__.py  |   2 -
 .../workflows/builtin/test_execute_operation.py |  22 +-
 .../orchestrator/workflows/builtin/test_heal.py |  27 +-
 .../workflows/builtin/test_install.py   |  11 +-
 .../workflows/builtin/test_uninstall.py |  12 +-
 .../orchestrator/workflows/core/test_engine.py  |   5 +-
 tests/orchestrator/workflows/core/test_task.py  |  11 +-
 .../test_task_graph_into_exececution_graph.py   |   3 +-
 tests/storage/__init__.py   |   4 +-
 tests/storage/test_model_storage.py |  37 +--
 tests/storage/test_models.py|  37 ++-
 tests/storage/test_resource_storage.py  |   6 +-
 28 files changed, 399 insertions(+), 382 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/e1441f90/aria/__init__.py
--
diff --git a/aria/__init__.py b/aria/__init__.py
index 5317afa..f5151e3 100644
--- a/aria/__init__.py
+++ b/aria/__init__.py
@@ -56,7 +56,7 @@ def install_aria_extensions():
 del sys.modules[module_name]
 
 
-def application_model_storage(api, api_params=None):
+def application_model_storage(api, api_kwargs=None):
 """
 Initiate model storage for the supplied storage driver
 """
@@ -76,7 +76,7 @@ def application_model_storage(api, api_params=None):
 storage.models.Task,
 ]
 # if api not in _model_storage:
-return storage.ModelStorage(api, items=models, api_params=api_params or {})
+return storage.ModelStorage(api, items=models, api_kwargs=api_kwargs or {})
 
 
 def application_resource_storage(driver):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/e1441f90/aria/orchestrator/context/common.py
--
diff --git a/aria/orchestrator/context/common.py 
b/aria/orchestrator/context/common.py
index a4cc4a4..75bb0fb 100644
--- a/aria/orchestrator/context/common.py
+++ b/aria/orchestrator/context/common.py
@@ -32,8 +32,8 @@ class BaseContext(logger.LoggerMixin):
 model_storage,
 resource_storage,
 deployment_id,
-workflow_id,
-execution_id=None,
+workflow_name,
+execution_name=None,
 task_max_attempts=1,
 task_retry_interval=0,
 task_ignore_failure=False,
@@ -44,8 +44,8 @@ class BaseContext(logger.LoggerMixin):
 self._model = model_storage
 self._resource = resource_storage
 self._deployment_id = deployment_id
-self._workflow_id = workflow_id
-self._execution_id = execution_id or str(uuid4())
+self._workflow_name = workflow_name
+self._execution_name = execution_name or str(uuid4())
 self._task_max_attempts = task_max_attempts
 self._task_retry_interval = task_retry_interval
 self._task_ignore_failure = task_ignore_failure
@@ -54,8 +54,8 @@ class BaseContext(logger.LoggerMixin):
 return (
 '{name}(name={self.name}, '
 'deployment_id={self._deployment_id}, '
-'wor

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

2016-12-04 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-30-SQL-based-storage-implementation 9a608318b -> b60199ba5 
(forced update)


code review 2 - wip


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

Branch: refs/heads/ARIA-30-SQL-based-storage-implementation
Commit: b60199ba57c09555782873e4d03313ff661bb13b
Parents: 5ea0b63
Author: mxmrlv 
Authored: Sun Dec 4 18:56:02 2016 +0200
Committer: mxmrlv 
Committed: Sun Dec 4 19:04:38 2016 +0200

--
 aria/__init__.py|   4 +-
 aria/orchestrator/context/toolbelt.py   |   2 +-
 aria/orchestrator/context/workflow.py   |   8 +-
 aria/orchestrator/workflows/core/task.py|  14 +-
 aria/storage/core.py|   8 +-
 aria/storage/models.py  | 195 +--
 aria/storage/sql_mapi.py|  53 +++--
 aria/storage/structures.py  |  34 +---
 tests/mock/context.py   |   6 +-
 tests/mock/models.py|  28 +--
 tests/orchestrator/context/test_workflow.py |   4 +-
 .../orchestrator/workflows/builtin/__init__.py  |   2 -
 .../workflows/builtin/test_execute_operation.py |  14 +-
 .../orchestrator/workflows/builtin/test_heal.py |  16 +-
 .../workflows/builtin/test_install.py   |  11 +-
 .../workflows/builtin/test_uninstall.py |  12 +-
 .../orchestrator/workflows/core/test_engine.py  |   2 +-
 tests/storage/__init__.py   |   4 +-
 tests/storage/test_model_storage.py |  29 +--
 tests/storage/test_models.py|  14 +-
 tests/storage/test_resource_storage.py  |   6 +-
 21 files changed, 229 insertions(+), 237 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b60199ba/aria/__init__.py
--
diff --git a/aria/__init__.py b/aria/__init__.py
index 5317afa..f5151e3 100644
--- a/aria/__init__.py
+++ b/aria/__init__.py
@@ -56,7 +56,7 @@ def install_aria_extensions():
 del sys.modules[module_name]
 
 
-def application_model_storage(api, api_params=None):
+def application_model_storage(api, api_kwargs=None):
 """
 Initiate model storage for the supplied storage driver
 """
@@ -76,7 +76,7 @@ def application_model_storage(api, api_params=None):
 storage.models.Task,
 ]
 # if api not in _model_storage:
-return storage.ModelStorage(api, items=models, api_params=api_params or {})
+return storage.ModelStorage(api, items=models, api_kwargs=api_kwargs or {})
 
 
 def application_resource_storage(driver):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b60199ba/aria/orchestrator/context/toolbelt.py
--
diff --git a/aria/orchestrator/context/toolbelt.py 
b/aria/orchestrator/context/toolbelt.py
index ceaeb72..ae0e1ff 100644
--- a/aria/orchestrator/context/toolbelt.py
+++ b/aria/orchestrator/context/toolbelt.py
@@ -33,7 +33,7 @@ class NodeToolBelt(object):
 :return:
 """
 assert isinstance(self._op_context, operation.NodeOperationContext)
-filters = {'target_node_instance_fk': 
self._op_context.node_instance.storage_id}
+filters = {'target_node_instance_storage_id': 
self._op_context.node_instance.storage_id}
 for relationship_instance in \
 
self._op_context.model.relationship_instance.iter(filters=filters):
 yield relationship_instance.source_node_instance

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b60199ba/aria/orchestrator/context/workflow.py
--
diff --git a/aria/orchestrator/context/workflow.py 
b/aria/orchestrator/context/workflow.py
index 0540590..5ec4044 100644
--- a/aria/orchestrator/context/workflow.py
+++ b/aria/orchestrator/context/workflow.py
@@ -53,8 +53,8 @@ class WorkflowContext(BaseContext):
 now = datetime.utcnow()
 execution = self.model.execution.model_cls(
 id=self._execution_id,
-blueprint_fk=self.blueprint.storage_id,
-deployment_fk=self.deployment.storage_id,
+blueprint_storage_id=self.blueprint.storage_id,
+deployment_storage_id=self.deployment.storage_id,
 workflow_id=self._workflow_id,
 created_at=now,
 status=execution_cls.PENDING,
@@ -69,7 +69,7 @@ class WorkflowContext(BaseContext):
 """