diff --git a/.zuul.yaml b/.zuul.yaml index 43e934c69..8d3397905 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -14,15 +14,15 @@ - openstack-tox-pep8: required-projects: - name: openstack/requirements - override-checkout: stable/queens + override-checkout: stable/rocky - openstack-tox-py27: required-projects: - name: openstack/requirements - override-checkout: stable/queens + override-checkout: stable/rocky - openstack-tox-py35: required-projects: - name: openstack/requirements - override-checkout: stable/queens + override-checkout: stable/rocky - legacy-group-based-policy-dsvm-functional: voting: false - legacy-group-based-policy-dsvm-aim: @@ -34,12 +34,12 @@ - openstack-tox-pep8: required-projects: - name: openstack/requirements - override-checkout: stable/queens + override-checkout: stable/rocky - openstack-tox-py27: required-projects: - name: openstack/requirements - override-checkout: stable/queens + override-checkout: stable/rocky - openstack-tox-py35: required-projects: - name: openstack/requirements - override-checkout: stable/queens + override-checkout: stable/rocky diff --git a/devstack/lib/nfp b/devstack/lib/nfp index 72757532d..89fa2a72b 100644 --- a/devstack/lib/nfp +++ b/devstack/lib/nfp @@ -25,7 +25,7 @@ NEUTRON_CONF_DIR=/etc/neutron NEUTRON_CONF=$NEUTRON_CONF_DIR/neutron.conf NFP_CONF_DIR=/etc/nfp DISKIMAGE_CREATE_DIR=$NFPSERVICE_DIR/gbpservice/contrib/nfp/tools/image_builder -NEUTRON_SRC_BRANCH_FOR_NFP_CONTROLLER=stable/queens +NEUTRON_SRC_BRANCH_FOR_NFP_CONTROLLER=stable/rocky # Save trace setting XTRACE=$(set +o | grep xtrace) diff --git a/devstack/local.conf.nfp b/devstack/local.conf.nfp index 5b8b331a8..6505a494a 100644 --- a/devstack/local.conf.nfp +++ b/devstack/local.conf.nfp @@ -43,11 +43,11 @@ if [[ $ENABLE_NFP = True ]]; then # Make sure that your public interface is not attached to any bridge. PUBLIC_INTERFACE= - enable_plugin neutron-fwaas http://opendev.org/openstack/neutron-fwaas.git stable/queens - enable_plugin neutron-lbaas https://opendev.org/openstack/neutron-lbaas.git stable/queens - enable_plugin neutron https://opendev.org/openstack/neutron.git stable/queens - enable_plugin neutron-vpnaas https://opendev.org/openstack/neutron-vpnaas.git stable/queens - enable_plugin octavia https://opendev.org/openstack/octavia.git stable/queens + enable_plugin neutron-fwaas http://opendev.org/openstack/neutron-fwaas.git stable/rocky + enable_plugin neutron-lbaas https://opendev.org/openstack/neutron-lbaas.git stable/rocky + enable_plugin neutron https://opendev.org/openstack/neutron.git stable/rocky + enable_plugin neutron-vpnaas https://opendev.org/openstack/neutron-vpnaas.git stable/rocky + enable_plugin octavia https://opendev.org/openstack/octavia.git stable/rocky fi fi diff --git a/devstack/settings b/devstack/settings index 48a30e9e4..0a92b587d 100755 --- a/devstack/settings +++ b/devstack/settings @@ -25,13 +25,13 @@ GIT_BASE=${GIT_BASE:-https://opendev.org} GBPSERVICE_REPO=${GBPSERVICE_REPO:-${GIT_BASE}/x/group-based-policy.git} GBPSERVICE_BRANCH=${GBPSERVICE_BRANCH:-master} GBPCLIENT_REPO=${GBPCLIENT_REPO:-${GIT_BASE}/x/python-group-based-policy-client.git} -GBPCLIENT_BRANCH=${GBPCLIENT_BRANCH:-master} +GBPCLIENT_BRANCH=${GBPCLIENT_BRANCH:-stable/rocky} GBPUI_REPO=${GBPUI_REPO:-${GIT_BASE}/x/group-based-policy-ui.git} GBPUI_BRANCH=${GBPUI_BRANCH:-master} GBPHEAT_REPO=${GBPHEAT_REPO:-${GIT_BASE}/x/group-based-policy-automation.git} GBPHEAT_BRANCH=${GBPHEAT_BRANCH:-master} AIM_BRANCH=${AIM_BRANCH:-master} -OPFLEX_BRANCH=${OPFLEX_BRANCH:-master} +OPFLEX_BRANCH=${OPFLEX_BRANCH:-stable/rocky} APICAPI_BRANCH=${APICAPI_BRANCH:-master} ACITOOLKIT_BRANCH=${ACITOOLKIT_BRANCH:-noiro-lite} diff --git a/devstack/lib/nsx b/gbpservice/contrib/vmware/nsx similarity index 100% rename from devstack/lib/nsx rename to gbpservice/contrib/vmware/nsx diff --git a/doc/source/devref/nsx-policy-driver.rst b/gbpservice/contrib/vmware/nsx-policy-driver.rst similarity index 100% rename from doc/source/devref/nsx-policy-driver.rst rename to gbpservice/contrib/vmware/nsx-policy-driver.rst diff --git a/gbpservice/neutron/services/grouppolicy/drivers/vmware/nsx_policy/nsx_policy_mapping.py b/gbpservice/contrib/vmware/nsx_policy_mapping.py similarity index 100% rename from gbpservice/neutron/services/grouppolicy/drivers/vmware/nsx_policy/nsx_policy_mapping.py rename to gbpservice/contrib/vmware/nsx_policy_mapping.py diff --git a/gbpservice/neutron/tests/unit/services/grouppolicy/test_nsx_policy_mapping_driver.py b/gbpservice/contrib/vmware/test_nsx_policy_mapping_driver.py similarity index 100% rename from gbpservice/neutron/tests/unit/services/grouppolicy/test_nsx_policy_mapping_driver.py rename to gbpservice/contrib/vmware/test_nsx_policy_mapping_driver.py diff --git a/gbpservice/neutron/db/api.py b/gbpservice/neutron/db/api.py index e7a6f3450..964d6c3cf 100644 --- a/gbpservice/neutron/db/api.py +++ b/gbpservice/neutron/db/api.py @@ -20,14 +20,13 @@ # corresponding to the newest neutron branch supported by this # repository. -from neutron.db import api as old_api from neutron_lib.db import api get_context_manager = api.get_context_manager get_reader_session = api.get_reader_session get_writer_session = api.get_writer_session -is_retriable = old_api.is_retriable -retry_db_errors = old_api.retry_db_errors -retry_if_session_inactive = old_api.retry_if_session_inactive -CONTEXT_READER = get_context_manager().reader -CONTEXT_WRITER = get_context_manager().writer +is_retriable = api.is_retriable +retry_db_errors = api.retry_db_errors +retry_if_session_inactive = api.retry_if_session_inactive +CONTEXT_READER = api.CONTEXT_READER +CONTEXT_WRITER = api.CONTEXT_WRITER diff --git a/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py b/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py index 72ef5fc40..c3394211c 100644 --- a/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py +++ b/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py @@ -4912,7 +4912,9 @@ class ApicMechanismDriver(api_plus.MechanismDriver, # This is only needed for baremetal VNIC types, as they don't # have agents to perform port binding. subport_db = self.plugin._get_port(context, first_subport_id) - if subport_db.port_binding.vnic_type != portbindings.VNIC_BAREMETAL: + if (not subport_db.port_bindings or + subport_db.port_bindings[0].vnic_type != + portbindings.VNIC_BAREMETAL): return if event == events.AFTER_DELETE: parent_port = None @@ -5674,12 +5676,14 @@ class ApicMechanismDriver(api_plus.MechanismDriver, port = self.plugin._make_port_dict(port_db) network = self.plugin.get_network( plugin_context, port_db.network_id) - host = port_db.port_binding.host if port_db.port_binding else None + host = (port_db.port_bindings[0].host if port_db.port_bindings + else None) levels = (n_db.get_binding_levels(plugin_context, port_id, host) if host else None) return ml2_context.PortContext( self.plugin, plugin_context, port, network, - port_db.port_binding, levels) + port_db.port_bindings[0] if port_db.port_bindings else None, + levels) def _add_network_mapping_and_notify(self, context, network_id, bd, epg, vrf): @@ -6454,7 +6458,7 @@ class ApicMechanismDriver(api_plus.MechanismDriver, query += lambda q: q.options( orm.joinedload('binding_levels')) for port in query(mgr.actual_session): - binding = port.port_binding + binding = port.port_bindings[0] if port.port_bindings else None levels = port.binding_levels unbind = False # REVISIT: Validate that vif_type and vif_details are diff --git a/gbpservice/neutron/plugins/ml2plus/plugin.py b/gbpservice/neutron/plugins/ml2plus/plugin.py index 7b5ee5bb7..ee2409ff5 100644 --- a/gbpservice/neutron/plugins/ml2plus/plugin.py +++ b/gbpservice/neutron/plugins/ml2plus/plugin.py @@ -22,7 +22,6 @@ from gbpservice.neutron.plugins.ml2plus import patch_neutron # noqa from neutron.common import constants as n_const from neutron.common import utils as n_utils from neutron.db import _resource_extend as resource_extend -from neutron.db import _utils as db_utils from neutron.db.models import securitygroup as securitygroups_db from neutron.db import models_v2 from neutron.plugins.ml2.common import exceptions as ml2_exc @@ -38,6 +37,7 @@ from neutron_lib.api import validators from neutron_lib.callbacks import events from neutron_lib.callbacks import registry from neutron_lib.callbacks import resources +from neutron_lib.db import utils as db_utils from neutron_lib.plugins import directory from oslo_log import log from oslo_utils import excutils diff --git a/gbpservice/neutron/services/apic_aim/l3_plugin.py b/gbpservice/neutron/services/apic_aim/l3_plugin.py index 1744ad188..205d4bf06 100644 --- a/gbpservice/neutron/services/apic_aim/l3_plugin.py +++ b/gbpservice/neutron/services/apic_aim/l3_plugin.py @@ -17,7 +17,6 @@ from neutron.api import extensions from neutron.common import utils as n_utils from neutron.db import _model_query as model_query from neutron.db import _resource_extend as resource_extend -from neutron.db import _utils as db_utils from neutron.db import common_db_mixin from neutron.db import dns_db from neutron.db import extraroute_db @@ -26,6 +25,7 @@ from neutron.db.models import l3 as l3_db from neutron.quota import resource_registry from neutron_lib.api.definitions import l3 as l3_def from neutron_lib.api.definitions import portbindings +from neutron_lib.db import utils as db_utils from neutron_lib import exceptions from neutron_lib.plugins import constants from neutron_lib.plugins import directory diff --git a/gbpservice/neutron/services/grouppolicy/drivers/vmware/__init__.py b/gbpservice/neutron/services/grouppolicy/drivers/vmware/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/gbpservice/neutron/services/grouppolicy/drivers/vmware/nsx_policy/__init__.py b/gbpservice/neutron/services/grouppolicy/drivers/vmware/nsx_policy/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/gbpservice/tests/contrib/devstack/local-aim.conf b/gbpservice/tests/contrib/devstack/local-aim.conf index 87ab29542..ed0a9e6cb 100644 --- a/gbpservice/tests/contrib/devstack/local-aim.conf +++ b/gbpservice/tests/contrib/devstack/local-aim.conf @@ -13,11 +13,11 @@ SKIP_EXERCISES=volumes,trove,swift,sahara,euca,bundle,boot_from_volume,aggregate enable_plugin group-based-policy https://opendev.org/x/group-based-policy.git master -enable_plugin networking-sfc https://opendev.org/openstack/networking-sfc.git stable/queens +enable_plugin networking-sfc https://opendev.org/openstack/networking-sfc.git stable/rocky ENABLE_APIC_AIM_GATE=True AIM_BRANCH=master -OPFLEX_BRANCH=master +OPFLEX_BRANCH=stable/rocky APICAPI_BRANCH=master ACITOOLKIT_BRANCH=noiro-lite diff --git a/gbpservice/tests/contrib/devstack/local-nfp.conf b/gbpservice/tests/contrib/devstack/local-nfp.conf index 86b62ac31..757c7d615 100644 --- a/gbpservice/tests/contrib/devstack/local-nfp.conf +++ b/gbpservice/tests/contrib/devstack/local-nfp.conf @@ -20,7 +20,7 @@ GBPSERVICE_BRANCH=master #GBPSERVICE_BRANCH=refs/changes/85/298385/154 GBPCLIENT_REPO=${GIT_BASE}/x/python-group-based-policy-client.git -GBPCLIENT_BRANCH=master +GBPCLIENT_BRANCH=stable/rocky #GBPCLIENT_REPO=https://review.openstack.org/openstack/python-group-based-policy-client #GBPCLIENT_BRANCH=refs/changes/95/311695/3 @@ -45,13 +45,13 @@ enable_service q-svc enable_service q-agt enable_service q-dhcp enable_service q-l3 -enable_plugin neutron-fwaas https://opendev.org/openstack/neutron-fwaas.git stable/queens -enable_plugin neutron-lbaas https://opendev.org/openstack/neutron-lbaas.git stable/queens -enable_plugin neutron https://opendev.org/openstack/neutron.git stable/queens +enable_plugin neutron-fwaas https://opendev.org/openstack/neutron-fwaas.git stable/rocky +enable_plugin neutron-lbaas https://opendev.org/openstack/neutron-lbaas.git stable/rocky +enable_plugin neutron https://opendev.org/openstack/neutron.git stable/rocky #ENBALE OCTAVIA -enable_plugin octavia https://opendev.org/openstack/octavia stable/queens +enable_plugin octavia https://opendev.org/openstack/octavia stable/rocky #ENABLED_SERVICES+=,octavia,o-cw,o-hk,o-hm,o-api enable_service q-fwaas-v1 diff --git a/gbpservice/tests/contrib/devstack/local.conf b/gbpservice/tests/contrib/devstack/local.conf index 0c0814b2d..c828e92ae 100644 --- a/gbpservice/tests/contrib/devstack/local.conf +++ b/gbpservice/tests/contrib/devstack/local.conf @@ -20,7 +20,7 @@ GBPSERVICE_BRANCH=master #GBPSERVICE_BRANCH=refs/changes/54/240954/47 GBPCLIENT_REPO=${GIT_BASE}/x/python-group-based-policy-client.git -GBPCLIENT_BRANCH=master +GBPCLIENT_BRANCH=stable/rocky #GBPCLIENT_REPO=https://review.openstack.org/openstack/python-group-based-policy-client #GBPCLIENT_BRANCH=refs/changes/55/435155/1 diff --git a/gbpservice/tests/contrib/functions-gbp b/gbpservice/tests/contrib/functions-gbp index 99053aa80..32a8db9e4 100644 --- a/gbpservice/tests/contrib/functions-gbp +++ b/gbpservice/tests/contrib/functions-gbp @@ -16,7 +16,7 @@ XTRACE=$(set +o | grep xtrace) function prepare_gbp_devstack_pre { cd $TOP_DIR - sudo git checkout stable/queens + sudo git checkout stable/rocky sudo sed -i 's/DEST=\/opt\/stack/DEST=\/opt\/stack\/new/g' $TOP_DIR/stackrc sudo sed -i 's/source $TOP_DIR\/lib\/neutron/source $TOP_DIR\/lib\/neutron\nsource $TOP_DIR\/lib\/neutron-legacy/g' $TOP_DIR/stack.sh } @@ -25,15 +25,15 @@ function prepare_gbp_devstack_post { # The following should updated when master moves to a new release # We need to do the following since the infra job clones these repos and # checks out the master branch (as this is the master branch) and later - # does not switch to the stable/queens branch when installing devstack + # does not switch to the stable/rocky branch when installing devstack # since the repo is already present. # This can be worked around by changing the job description in - # project-config to set BRANCH_OVERRIDE to use the stable/queens branch - sudo git --git-dir=/opt/stack/new/neutron/.git --work-tree=/opt/stack/new/neutron checkout stable/queens - sudo git --git-dir=/opt/stack/new/nova/.git --work-tree=/opt/stack/new/nova checkout stable/queens - sudo git --git-dir=/opt/stack/new/keystone/.git --work-tree=/opt/stack/new/keystone checkout stable/queens - sudo git --git-dir=/opt/stack/new/cinder/.git --work-tree=/opt/stack/new/cinder checkout stable/queens - sudo git --git-dir=/opt/stack/new/requirements/.git --work-tree=/opt/stack/new/requirements checkout stable/queens + # project-config to set BRANCH_OVERRIDE to use the stable/rocky branch + sudo git --git-dir=/opt/stack/new/neutron/.git --work-tree=/opt/stack/new/neutron checkout stable/rocky + sudo git --git-dir=/opt/stack/new/nova/.git --work-tree=/opt/stack/new/nova checkout stable/rocky + sudo git --git-dir=/opt/stack/new/keystone/.git --work-tree=/opt/stack/new/keystone checkout stable/rocky + sudo git --git-dir=/opt/stack/new/cinder/.git --work-tree=/opt/stack/new/cinder checkout stable/rocky + sudo git --git-dir=/opt/stack/new/requirements/.git --work-tree=/opt/stack/new/requirements checkout stable/rocky source $TOP_DIR/functions source $TOP_DIR/functions-common diff --git a/test-requirements.txt b/test-requirements.txt index 9fa834203..66887e4fc 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,22 +1,19 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=1.1.0,<1.2.0 # Apache-2.0 --e git+https://opendev.org/openstack/neutron.git@stable/queens#egg=neutron --e git+https://opendev.org/openstack/neutron-vpnaas.git@stable/queens#egg=neutron-vpnaas --e git+https://opendev.org/openstack/neutron-lbaas.git@stable/queens#egg=neutron-lbaas --e git+https://opendev.org/openstack/neutron-fwaas.git@stable/queens#egg=neutron-fwaas --e git+https://opendev.org/openstack/networking-sfc.git@stable/queens#egg=networking-sfc +-e git+https://opendev.org/openstack/neutron.git@stable/rocky#egg=neutron +-e git+https://opendev.org/openstack/neutron-vpnaas.git@stable/rocky#egg=neutron-vpnaas +-e git+https://opendev.org/openstack/neutron-lbaas.git@stable/rocky#egg=neutron-lbaas +-e git+https://opendev.org/openstack/neutron-fwaas.git@stable/rocky#egg=neutron-fwaas +-e git+https://opendev.org/openstack/networking-sfc.git@stable/rocky#egg=networking-sfc -e git+https://github.com/noironetworks/apicapi.git@master#egg=apicapi --e git+https://github.com/noironetworks/python-opflex-agent.git@stable/queens#egg=python-opflexagent-agent +-e git+https://github.com/noironetworks/python-opflex-agent.git@stable/rocky#egg=python-opflexagent-agent --e git+https://github.com/openstack/vmware-nsx.git@stable/queens#egg=vmware_nsx --e git+https://github.com/openstack/vmware-nsxlib.git@stable/queens#egg=vmware_nsxlib - --e git+https://opendev.org/x/python-group-based-policy-client.git@stable/queens#egg=gbpclient +-e git+https://opendev.org/x/python-group-based-policy-client.git@stable/rocky#egg=gbpclient coverage!=4.4,>=4.0 # Apache-2.0 flake8-import-order==0.12 # LGPLv3 @@ -30,7 +27,7 @@ oslotest>=3.2.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0 # Since version numbers for these are specified in -# https://releases.openstack.org/constraints/upper/queens, they cannot be +# https://releases.openstack.org/constraints/upper/rocky, they cannot be # referenced as GIT URLs. python-heatclient python-keystoneclient diff --git a/tox.ini b/tox.ini index 2ff6b1f06..31825e5ea 100644 --- a/tox.ini +++ b/tox.ini @@ -12,9 +12,9 @@ setenv = VIRTUAL_ENV={envdir} passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY usedevelop = True install_command = - pip install -U {opts} {packages} + pip install {opts} {packages} deps = - -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/queens} + -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/rocky} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt whitelist_externals = sh