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: removed all api_kwargs
Date Tue, 07 Feb 2017 14:58:59 GMT
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-42-Generic-ctx-serialization-mechanism e2d2cc1db -> c8f75c8c3


removed all api_kwargs


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

Branch: refs/heads/ARIA-42-Generic-ctx-serialization-mechanism
Commit: c8f75c8c32af6045f662ef8af88d34ba6fc977e3
Parents: e2d2cc1
Author: mxmrlv <mxmrlv@gmail.com>
Authored: Tue Feb 7 16:58:45 2017 +0200
Committer: mxmrlv <mxmrlv@gmail.com>
Committed: Tue Feb 7 16:58:45 2017 +0200

----------------------------------------------------------------------
 aria/__init__.py                       | 6 ++----
 aria/storage/core.py                   | 6 ++----
 tests/storage/test_resource_storage.py | 6 +++---
 3 files changed, 7 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/c8f75c8c/aria/__init__.py
----------------------------------------------------------------------
diff --git a/aria/__init__.py b/aria/__init__.py
index f3858c0..ec279fc 100644
--- a/aria/__init__.py
+++ b/aria/__init__.py
@@ -57,7 +57,7 @@ def install_aria_extensions():
     extension.init()
 
 
-def application_model_storage(api, api_kwargs=None, initiator=None, initiator_kwargs=None):
+def application_model_storage(api, initiator=None, initiator_kwargs=None):
     """
     Initiate model storage
     """
@@ -79,19 +79,17 @@ def application_model_storage(api, api_kwargs=None, initiator=None, initiator_kw
         storage.model.Task,
     ]
     return storage.ModelStorage(api,
-                                api_kwargs=api_kwargs or {},
                                 items=models,
                                 initiator=initiator,
                                 initiator_kwargs=initiator_kwargs or {})
 
 
-def application_resource_storage(api, api_kwargs=None, initiator=None, initiator_kwargs=None):
+def application_resource_storage(api, initiator=None, initiator_kwargs=None):
     """
     Initiate resource storage
     """
 
     return storage.ResourceStorage(api,
-                                   api_kwargs=api_kwargs or {},
                                    items=['blueprint', 'deployment', 'plugin'],
                                    initiator=initiator,
                                    initiator_kwargs=initiator_kwargs)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/c8f75c8c/aria/storage/core.py
----------------------------------------------------------------------
diff --git a/aria/storage/core.py b/aria/storage/core.py
index b945d5f..c45f2f2 100644
--- a/aria/storage/core.py
+++ b/aria/storage/core.py
@@ -57,7 +57,6 @@ class Storage(LoggerMixin):
     """
     def __init__(self,
                  api_cls,
-                 api_kwargs=None,
                  items=(),
                  initiator=None,
                  initiator_kwargs=None,
@@ -66,12 +65,11 @@ class Storage(LoggerMixin):
         self.api = api_cls
         self.registered = {}
         self._initiator = initiator
-        self._api_kwargs = api_kwargs or {}
         self._initiator_kwargs = initiator_kwargs or {}
         if self._initiator:
-            self._api_kwargs.update(self._initiator(**self._initiator_kwargs))
+            self._api_kwargs = self._initiator(**self._initiator_kwargs)
         else:
-            self._api_kwargs.update(**self._initiator_kwargs)
+            self._api_kwargs = self._initiator_kwargs
         for item in items:
             self.register(item)
         self.logger.debug('{name} object is ready: {0!r}'.format(

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/c8f75c8c/tests/storage/test_resource_storage.py
----------------------------------------------------------------------
diff --git a/tests/storage/test_resource_storage.py b/tests/storage/test_resource_storage.py
index 9b5f782..6db27db 100644
--- a/tests/storage/test_resource_storage.py
+++ b/tests/storage/test_resource_storage.py
@@ -45,13 +45,13 @@ class TestResourceStorage(TestFileSystem):
 
     def _create_storage(self):
         return ResourceStorage(FileSystemResourceAPI,
-                               api_kwargs=dict(directory=self.path))
+                               initiator_kwargs=dict(directory=self.path))
 
     def test_name(self):
         api = FileSystemResourceAPI
         storage = ResourceStorage(FileSystemResourceAPI,
                                   items=['blueprint'],
-                                  api_kwargs=dict(directory=self.path))
+                                  initiator_kwargs=dict(directory=self.path))
         assert repr(storage) == 'ResourceStorage(api={api})'.format(api=api)
         assert 'directory={resource_dir}'.format(resource_dir=self.path) in \
                repr(storage.registered['blueprint'])
@@ -62,7 +62,7 @@ class TestResourceStorage(TestFileSystem):
         assert os.path.exists(os.path.join(self.path, 'blueprint'))
 
     def test_upload_file(self):
-        storage = ResourceStorage(FileSystemResourceAPI, api_kwargs=dict(directory=self.path))
+        storage = ResourceStorage(FileSystemResourceAPI, initiator_kwargs=dict(directory=self.path))
         self._create(storage)
         tmpfile_path = tempfile.mkstemp(suffix=self.__class__.__name__, dir=self.path)[1]
         self._upload(storage, tmpfile_path, id='blueprint_id')


Mime
View raw message