Fix service ports init.

Change-Id: I0f26a88e329c787d10acc5395aa30929748acc64
This commit is contained in:
Nicola Peditto 2020-12-15 18:14:14 +01:00
parent a71417de71
commit b8c15ff317
6 changed files with 34 additions and 9 deletions

View File

@ -31,7 +31,7 @@ class Location(base.APIBase):
fields = list(objects.Location.fields) fields = list(objects.Location.fields)
for k in fields: for k in fields:
# Skip fields we do not expose. # Skip fields we do not expose.
if k is not 'created_at': if k != 'created_at':
if not hasattr(self, k): if not hasattr(self, k):
continue continue
self.fields.append(k) self.fields.append(k)

View File

@ -327,6 +327,7 @@ class LocalLinkConnectionType(wtypes.UserType):
return None return None
return LocalLinkConnectionType.validate(value) return LocalLinkConnectionType.validate(value)
locallinkconnectiontype = LocalLinkConnectionType() locallinkconnectiontype = LocalLinkConnectionType()

View File

@ -43,7 +43,7 @@ serializer = objects_base.IotronicObjectSerializer()
Port = list() Port = list()
SERVICE_PORT_LIST = None SERVICE_PORT_LIST = []
def versionCompare(v1, v2): def versionCompare(v1, v2):

View File

@ -204,7 +204,6 @@ class Plugin(base.IotronicObject):
""" """
current = self.__class__.get_by_uuid(self._context, self.uuid) current = self.__class__.get_by_uuid(self._context, self.uuid)
for field in self.fields: for field in self.fields:
if (hasattr( if (hasattr(self, base.get_attrname(field))
self, base.get_attrname(field)) and self[field] != current[field]):
and self[field] != current[field]): self[field] = current[field]
self[field] = current[field]

26
tox.ini
View File

@ -1,6 +1,6 @@
[tox] [tox]
minversion = 2.3.1 minversion = 2.3.1
envlist = py35,pep8 envlist = py38,pep8
skipsdist = True skipsdist = True
[testenv] [testenv]
@ -19,12 +19,30 @@ commands =
find . -type f -name "*.pyc" -delete find . -type f -name "*.pyc" -delete
[testenv:pep8] [testenv:pep8]
basepython = python2.7 basepython = python3.8
#commands = /usr/local/bin/flake8 {posargs}
commands = 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] [testenv:py35]
basepython = python3.5 basepython = python3.5
[testenv:py38]
basepython = python3.8
[flake8] [flake8]
# TODO(dmllr): Analyze or fix the warnings blacklisted below # 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. # E123, E125 skipped as they are invalid PEP-8.
show-source = True show-source = True
builtins = _ 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 exclude = .venv,.git,.tox,dist,doc,etc,*lib/python*,*egg,build

5
zuul.d/projects.yaml Normal file
View File

@ -0,0 +1,5 @@
- project:
templates:
- openstack-python38-jobs-no-constraints
- check-requirements
- publish-to-pypi