From 2639d8964d5dc49bebeee35bb92760220282400d Mon Sep 17 00:00:00 2001 From: Boden R Date: Wed, 20 Feb 2019 15:27:02 +0800 Subject: [PATCH] fix gate A few fixes to get the tricircle gate working: - Remove the depend on neutron common exception. - Update lower-constraints for unneeded version constraining. - The changes from https://review.openstack.org/#/c/596420/ - Adds neutron and sfc to the functional playbook - Separates the neutron and networking-sfc requirements into sibling-requirements.txt so they are not picked up by devstack and updates tox.ini as needed for them. Change-Id: Icd6b36e613456b4af35eaf70ef95b4ef32ddf806 Signed-off-by: song baisen Co-Authored-By: tangzhuo , zhiyuan_cai --- .zuul.yaml | 2 ++ lower-constraints.txt | 1 - playbooks/tricircle-dsvm-functional/run.yaml | 3 ++- requirements.txt | 6 ++---- sibling-requirements.txt | 4 ++++ tox.ini | 2 ++ tricircle/network/central_plugin.py | 15 ++++++--------- .../tests/unit/network/test_central_plugin.py | 2 +- 8 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 sibling-requirements.txt diff --git a/.zuul.yaml b/.zuul.yaml index 7a7e8e0d..e8fd5c21 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -7,6 +7,8 @@ required-projects: - openstack-infra/devstack-gate - openstack/tricircle + - openstack/neutron + - openstack/networking-sfc - job: name: tricircle-multiregion diff --git a/lower-constraints.txt b/lower-constraints.txt index 99dd93fe..e71b0030 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -8,7 +8,6 @@ bandit==1.1.0 bashate==0.5.1 beautifulsoup4==4.6.0 cachetools==2.0.0 -cffi==1.7.0 cliff==2.8.0 cmd2==0.8.0 contextlib2==0.4.0 diff --git a/playbooks/tricircle-dsvm-functional/run.yaml b/playbooks/tricircle-dsvm-functional/run.yaml index 877ad978..1b945706 100644 --- a/playbooks/tricircle-dsvm-functional/run.yaml +++ b/playbooks/tricircle-dsvm-functional/run.yaml @@ -42,7 +42,8 @@ set -x export PYTHONUNBUFFERED=true export BRANCH_OVERRIDE=default - export PROJECTS="openstack/tricircle $PROJECTS" + export PROJECTS="openstack/tricircle openstack/neutron openstack/networking-sfc $PROJECTS" + export LIBS_FROM_GIT="neutron,networking-sfc" export DEVSTACK_GATE_NEUTRON=1 export DEVSTACK_GATE_TEMPEST=0 export DEVSTACK_GATE_TEMPEST_ALL_PLUGINS=0 diff --git a/requirements.txt b/requirements.txt index ae26867f..cd14b3d3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -43,10 +43,8 @@ oslo.upgradecheck>=0.1.1 # Apache-2.0 oslo.utils>=3.33.0 # Apache-2.0 sqlalchemy-migrate>=0.11.0 # Apache-2.0 -# These repos are installed from git in OpenStack CI if the job -# configures them as required-projects: -neutron>=12.0.0 # Apache-2.0 -networking-sfc>=6.0.0 # Apache-2.0 +# Uncomment or copy/paste the sibling requirements for release of project +# -r ./sibling-requirements.txt # The comment below indicates this project repo is current with neutron-lib # and should receive neutron-lib consumption patches as they are released diff --git a/sibling-requirements.txt b/sibling-requirements.txt new file mode 100644 index 00000000..7bbd65a7 --- /dev/null +++ b/sibling-requirements.txt @@ -0,0 +1,4 @@ +# These repos are installed from git in OpenStack CI if the job +# configures them as required-projects: +neutron>=12.0.0 # Apache-2.0 +networking-sfc>=6.0.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 27c4ba17..8dc1a4df 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,7 @@ passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS usedevelop = True deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/requirements.txt + -r{toxinidir}/sibling-requirements.txt -r{toxinidir}/test-requirements.txt whitelist_externals = sh @@ -67,6 +68,7 @@ deps = -c{toxinidir}/lower-constraints.txt -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt + -r{toxinidir}/sibling-requirements.txt [flake8] show-source = True diff --git a/tricircle/network/central_plugin.py b/tricircle/network/central_plugin.py index cc2b0ffe..2630b1c7 100644 --- a/tricircle/network/central_plugin.py +++ b/tricircle/network/central_plugin.py @@ -24,7 +24,6 @@ from oslo_db.sqlalchemy import utils as sa_utils import oslo_log.helpers as log_helpers from oslo_log import log -import neutron.common.exceptions as ml2_exceptions from neutron.conf.plugins.ml2 import config # noqa from neutron.db import agents_db from neutron.db.availability_zone import router as router_az @@ -336,7 +335,7 @@ class TricirclePlugin(db_base_plugin_v2.NeutronDbPluginV2, if not match: raise else: - raise ml2_exceptions.FlatNetworkInUse( + raise exceptions.FlatNetworkInUse( physical_network=match.groups()[0]) # process_extensions is set to False in _make_network_dict, so "tags" # field will not be set, we manually set here so openstack client can @@ -978,13 +977,11 @@ class TricirclePlugin(db_base_plugin_v2.NeutronDbPluginV2, try: # notify interested parties of imminent port deletion; # a failure here prevents the operation from happening - kwargs = { - 'context': context, - 'port_id': port_id, - 'port_check': port_check - } - registry.notify( - resources.PORT, events.BEFORE_DELETE, self, **kwargs) + registry.publish( + resources.PORT, events.BEFORE_DELETE, self, + payload=events.DBEventPayload( + context, metadata={'port_check': port_check}, + resource_id=port_id)) except callbacks_exc.CallbackFailure as e: # NOTE(xiulin): preserve old check's behavior if len(e.errors) == 1: diff --git a/tricircle/tests/unit/network/test_central_plugin.py b/tricircle/tests/unit/network/test_central_plugin.py index 474530a4..3e649ed1 100644 --- a/tricircle/tests/unit/network/test_central_plugin.py +++ b/tricircle/tests/unit/network/test_central_plugin.py @@ -967,7 +967,7 @@ def fake_filter_non_model_columns(data, model): @classmethod -def fake_load_obj(cls, context, db_obj): +def fake_load_obj(cls, context, db_obj, fields=None): return db_obj