You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by mx...@apache.org on 2016/12/01 10:56:19 UTC
incubator-ariatosca git commit: more lynting
Repository: incubator-ariatosca
Updated Branches:
refs/heads/ARIA-30-SQL-based-storage-implementation 2d6b9375d -> aaf35c1d2
more lynting
Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/aaf35c1d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/aaf35c1d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/aaf35c1d
Branch: refs/heads/ARIA-30-SQL-based-storage-implementation
Commit: aaf35c1d200687fc16fe886653b9aad4c1b0674f
Parents: 2d6b937
Author: mxmrlv <mx...@gmail.com>
Authored: Thu Dec 1 12:56:11 2016 +0200
Committer: mxmrlv <mx...@gmail.com>
Committed: Thu Dec 1 12:56:11 2016 +0200
----------------------------------------------------------------------
aria/__init__.py | 1 -
aria/storage/filesystem_api.py | 4 ++++
aria/storage/mapi/sql.py | 7 ++++---
aria/storage/models.py | 2 +-
aria/storage/rapi/filesystem.py | 6 +++---
aria/storage/structures.py | 7 +++----
6 files changed, 15 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/aaf35c1d/aria/__init__.py
----------------------------------------------------------------------
diff --git a/aria/__init__.py b/aria/__init__.py
index 2c00729..6e810f0 100644
--- a/aria/__init__.py
+++ b/aria/__init__.py
@@ -23,7 +23,6 @@ import pkgutil
from .VERSION import version as __version__
from .orchestrator.decorators import workflow, operation
-from . import storage
from . import (
utils,
parser,
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/aaf35c1d/aria/storage/filesystem_api.py
----------------------------------------------------------------------
diff --git a/aria/storage/filesystem_api.py b/aria/storage/filesystem_api.py
index d42cd61..f28d1f6 100644
--- a/aria/storage/filesystem_api.py
+++ b/aria/storage/filesystem_api.py
@@ -24,6 +24,10 @@ class BaseFileSystemAPI(api.StorageAPI):
"""
Base class which handles storage on the file system.
"""
+
+ def create(self, **kwargs):
+ super(BaseFileSystemAPI, self).create(**kwargs)
+
def __init__(self, *args, **kwargs):
super(BaseFileSystemAPI, self).__init__(*args, **kwargs)
self._lock = RLock()
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/aaf35c1d/aria/storage/mapi/sql.py
----------------------------------------------------------------------
diff --git a/aria/storage/mapi/sql.py b/aria/storage/mapi/sql.py
index f2ec0e5..4408aa3 100644
--- a/aria/storage/mapi/sql.py
+++ b/aria/storage/mapi/sql.py
@@ -49,7 +49,7 @@ class SQLAlchemyModelAPI(storage.api.ModelAPI):
self._engine = engine
self._session = session
- def get(self, entry_id, include=None, filters=None, locking=False):
+ def get(self, entry_id, include=None, filters=None, locking=False, **kwargs):
"""Return a single result based on the model class and element ID
"""
filters = filters or {'id': entry_id}
@@ -69,7 +69,8 @@ class SQLAlchemyModelAPI(storage.api.ModelAPI):
include=None,
filters=None,
pagination=None,
- sort=None):
+ sort=None,
+ **kwargs):
"""Return a (possibly empty) list of `model_class` results
"""
query = self._get_query(include, filters, sort)
@@ -91,7 +92,7 @@ class SQLAlchemyModelAPI(storage.api.ModelAPI):
self._safe_commit()
return entry
- def delete(self, entry_id, filters=None):
+ def delete(self, entry_id, filters=None, **kwargs):
"""Delete a single result based on the model class and element ID
"""
try:
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/aaf35c1d/aria/storage/models.py
----------------------------------------------------------------------
diff --git a/aria/storage/models.py b/aria/storage/models.py
index 9d0515e..c04f7d8 100644
--- a/aria/storage/models.py
+++ b/aria/storage/models.py
@@ -318,7 +318,7 @@ class DeploymentUpdate(SQLModelBase):
"""
return self.deployment.id
- def to_dict(self, suppress_error=False):
+ def to_dict(self, suppress_error=False, **kwargs):
dep_update_dict = super(DeploymentUpdate, self).to_dict(suppress_error)
# Taking care of the fact the DeploymentSteps are objects
dep_update_dict['steps'] = [step.to_dict() for step in self.steps]
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/aaf35c1d/aria/storage/rapi/filesystem.py
----------------------------------------------------------------------
diff --git a/aria/storage/rapi/filesystem.py b/aria/storage/rapi/filesystem.py
index ceafde5..a6c4ddf 100644
--- a/aria/storage/rapi/filesystem.py
+++ b/aria/storage/rapi/filesystem.py
@@ -21,10 +21,10 @@ from distutils import dir_util
from functools import partial
from aria.storage import (
- api,
- filesystem_api,
+ api,
+ filesystem_api,
exceptions
-)
+)
class FileSystemResourceAPI(api.ResourceAPI, filesystem_api.BaseFileSystemAPI):
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/aaf35c1d/aria/storage/structures.py
----------------------------------------------------------------------
diff --git a/aria/storage/structures.py b/aria/storage/structures.py
index 4f01524..b8b74fa 100644
--- a/aria/storage/structures.py
+++ b/aria/storage/structures.py
@@ -218,8 +218,7 @@ class SQLModelBase(Model):
# Indicates whether the `id` column in this class should be unique
is_id_unique = True
- @property
- def to_dict(self):
+ def to_dict(self, **kwargs):
"""
Convert the model into dict
:return:
@@ -231,7 +230,7 @@ class SQLModelBase(Model):
Convert the model into json.
:return:
"""
- return jsonpickle.encode(self.to_dict, unpicklable=False)
+ return jsonpickle.encode(self.to_dict(), unpicklable=False)
@classproperty
def fields(cls):
@@ -261,4 +260,4 @@ class SQLModelBase(Model):
return str(self)
def __eq__(self, other):
- return isinstance(other, self.__class__) and self.to_dict == other.to_dict
+ return isinstance(other, self.__class__) and self.to_dict() == other.to_dict()