diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..ddbc398 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,5 @@ +- project: + templates: + - openstack-python38-jobs-no-constraints + - check-requirements + - publish-to-pypi diff --git a/iotronic/api/controllers/v1/location.py b/iotronic/api/controllers/v1/location.py index 8f4bc76..dea46b6 100644 --- a/iotronic/api/controllers/v1/location.py +++ b/iotronic/api/controllers/v1/location.py @@ -31,7 +31,7 @@ class Location(base.APIBase): fields = list(objects.Location.fields) for k in fields: # Skip fields we do not expose. - if k is not 'created_at': + if k != 'created_at': if not hasattr(self, k): continue self.fields.append(k) diff --git a/iotronic/api/controllers/v1/types.py b/iotronic/api/controllers/v1/types.py index 30f7254..fa23de1 100644 --- a/iotronic/api/controllers/v1/types.py +++ b/iotronic/api/controllers/v1/types.py @@ -327,6 +327,7 @@ class LocalLinkConnectionType(wtypes.UserType): return None return LocalLinkConnectionType.validate(value) + locallinkconnectiontype = LocalLinkConnectionType() diff --git a/iotronic/conductor/endpoints.py b/iotronic/conductor/endpoints.py index 8a7fb56..7cdae95 100644 --- a/iotronic/conductor/endpoints.py +++ b/iotronic/conductor/endpoints.py @@ -43,7 +43,7 @@ serializer = objects_base.IotronicObjectSerializer() Port = list() -SERVICE_PORT_LIST = None +SERVICE_PORT_LIST = [] def versionCompare(v1, v2): diff --git a/iotronic/objects/plugin.py b/iotronic/objects/plugin.py index 201a06f..66c34af 100644 --- a/iotronic/objects/plugin.py +++ b/iotronic/objects/plugin.py @@ -204,7 +204,6 @@ class Plugin(base.IotronicObject): """ current = self.__class__.get_by_uuid(self._context, self.uuid) for field in self.fields: - if (hasattr( - self, base.get_attrname(field)) - and self[field] != current[field]): - self[field] = current[field] + if (hasattr(self, base.get_attrname(field)) + and self[field] != current[field]): + self[field] = current[field] diff --git a/tox.ini b/tox.ini index 99020df..ed81ad6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 2.3.1 -envlist = py35,pep8 +envlist = py38,pep8 skipsdist = True [testenv] @@ -19,12 +19,30 @@ commands = find . -type f -name "*.pyc" -delete [testenv:pep8] -basepython = python2.7 +basepython = python3.8 +#commands = /usr/local/bin/flake8 {posargs} commands = flake8 {posargs} +[testenv:venv] +commands = {posargs} + +[testenv:cover] +commands = python3 setup.py test --coverage --testr-args='{posargs}' + +[testenv:docs] +commands = + rm -fr doc/build + python3 setup.py build_sphinx + +[testenv:releasenotes] +commands = + sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html + [testenv:py35] basepython = python3.5 +[testenv:py38] +basepython = python3.8 [flake8] # TODO(dmllr): Analyze or fix the warnings blacklisted below @@ -35,5 +53,7 @@ basepython = python3.5 # E123, E125 skipped as they are invalid PEP-8. show-source = True builtins = _ -ignore = E711,E712,H404,H405,E123,E125,E901,H301 +#ignore = E711,E712,H404,H405,E123,E125,E901,H301 +ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,E711,E712,H405,W504,E731,H238,E126,E128,E731,H405,N530,W504,E129,E741,W503,F821,F999,F841,E402,W605 + exclude = .venv,.git,.tox,dist,doc,etc,*lib/python*,*egg,build