diff --git a/.gitreview b/.gitreview new file mode 100644 index 00000000..9bb6dad3 --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.openstack.org +port=29418 +project=stackforge/murano-api.git diff --git a/muranoapi/__init__.py b/muranoapi/__init__.py index 207fa154..7d93825c 100644 --- a/muranoapi/__init__.py +++ b/muranoapi/__init__.py @@ -10,4 +10,4 @@ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations -# under the License. \ No newline at end of file +# under the License. diff --git a/muranoapi/api/__init__.py b/muranoapi/api/__init__.py index fc46f490..8405b416 100644 --- a/muranoapi/api/__init__.py +++ b/muranoapi/api/__init__.py @@ -11,4 +11,3 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License.from oslo.config import cfg - diff --git a/muranoapi/api/middleware/__init__.py b/muranoapi/api/middleware/__init__.py index fc46f490..8405b416 100644 --- a/muranoapi/api/middleware/__init__.py +++ b/muranoapi/api/middleware/__init__.py @@ -11,4 +11,3 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License.from oslo.config import cfg - diff --git a/muranoapi/api/v1/router.py b/muranoapi/api/v1/router.py index b7d4625a..be83bb1c 100644 --- a/muranoapi/api/v1/router.py +++ b/muranoapi/api/v1/router.py @@ -14,8 +14,10 @@ import routes from muranoapi.openstack.common import wsgi -from muranoapi.api.v1 import (environments, sessions, - active_directories, webservers) +from muranoapi.api.v1 import environments +from muranoapi.api.v1 import sessions +from muranoapi.api.v1 import active_directories +from muranoapi.api.v1 import webservers class API(wsgi.Router): diff --git a/muranoapi/common/__init__.py b/muranoapi/common/__init__.py index fc46f490..8405b416 100644 --- a/muranoapi/common/__init__.py +++ b/muranoapi/common/__init__.py @@ -11,4 +11,3 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License.from oslo.config import cfg - diff --git a/muranoapi/db/models.py b/muranoapi/db/models.py index a7bee04f..9c044a06 100644 --- a/muranoapi/db/models.py +++ b/muranoapi/db/models.py @@ -36,7 +36,7 @@ def compile_big_int_sqlite(type_, compiler, **kw): class ModelBase(object): - __protected_attributes__ = {"created", "updated"} + __protected_attributes__ = set(["created", "updated"]) created = Column(DateTime, default=timeutils.utcnow, nullable=False) @@ -79,8 +79,7 @@ class ModelBase(object): def to_dict(self): dictionary = self.__dict__.copy() - return {k: v for k, v in dictionary.iteritems() - if k != '_sa_instance_state'} + return dict([(k, v) for k, v in dictionary.iteritems()]) class JsonBlob(TypeDecorator): diff --git a/muranoapi/tests/api/__init__.py b/muranoapi/tests/api/__init__.py index 207fa154..7d93825c 100644 --- a/muranoapi/tests/api/__init__.py +++ b/muranoapi/tests/api/__init__.py @@ -10,4 +10,4 @@ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations -# under the License. \ No newline at end of file +# under the License. diff --git a/tools/test-requires b/tools/test-requires index a7066f1e..d89a17c5 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -14,6 +14,7 @@ pep8==1.3.3 sphinx>=1.1.2 requests testtools>=0.9.22 +mock # Optional packages that should be installed when testing xattr>=0.6.0 diff --git a/tox.ini b/tox.ini index 793c1594..5a65dace 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,pep8 +envlist = py26,py27,pep8,pyflakes [testenv] setenv = VIRTUAL_ENV={envdir} @@ -44,3 +44,15 @@ commands = nosetests --cover-erase --cover-package=muranoapi --with-xcoverage deps = file://{toxinidir}/.cache.bundle setenv = NOSE_WITH_XUNIT=1 commands = {posargs} + +[testenv:pyflakes] +deps = flake8 +commands = flake8 + +[flake8] +# H301 one import per line +# H302 import only modules +ignore = H301,H302 +show-source = true +builtins = _ +exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools \ No newline at end of file