neutron.tests.unit.objects.test_ports.PortBindingDbObjectTestCase.test_get_duplicated_port_bindings fails on stable/xena with:
NotImplementedError: Operator 'getitem' is not supported on this expression
The code introduced in commit 2fb9ddb01ed44fae19c0184baa8620e95e51e344 [1] appears to depend on a sqlalchemy version that is higher than the minimum version specified in requirements.txt.
[1]
commit 2fb9ddb01ed44fae19c0184baa8620e95e51e344
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Mon Dec 12 05:10:01 2022 +0100
Delete the PB level registers when deleting the duplicated PB
The ``neutron-remove-duplicated-port-bindings`` script removes the
duplicated port binding registers ("ml2_port_bindings" table) that
have status=INACTIVE.
This patch also removes the corresponding port binding levels
("ml2_port_binding_levels" table) associated to those inactive port
bindings.
Closes-Bug: #2000078
Change-Id: I12fa0764cd0ff509f1859b61060d64cc5a54a7b9
(cherry picked from commit 572185e1fd252772d8baaec099bf8bedfc837013)
(cherry picked from commit 07855a68266484ae187c76708a727b8a4db1e2e2)
File "/root/neutron/neutron/tests/base.py", line 183, in func
return f(self, *args, **kwargs)
File "/root/neutron/neutron/tests/unit/objects/test_ports.py", line 68, in test_get_duplicated_port_bindings
dup_pb = ports.PortBinding.get_duplicated_port_bindings(self.context)
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 1012, in wrapper
return fn(*args, **kwargs)
File "/root/neutron/neutron/objects/ports.py", line 115, in get_duplicated_port_bindings
sqlalchemy.select(cls.db_model.port_id).
File "<string>", line 2, in select
File "<string>", line 2, in __init__
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/sqlalchemy/util/deprecations.py", line 139, in warned
return fn(*args, **kwargs)
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/sqlalchemy/sql/selectable.py", line 3114, in __init__
for c in columns:
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/sqlalchemy/sql/operators.py", line 432, in __getitem__
return self.operate(getitem, index)
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 226, in operate
return op(self.comparator, *other, **kwargs)
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/sqlalchemy/sql/operators.py", line 432, in __getitem__
return self.operate(getitem, index)
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/sqlalchemy/orm/properties.py", line 367, in operate
return op(self.__clause_element__(), *other, **kwargs)
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/sqlalchemy/sql/operators.py", line 432, in __getitem__
return self.operate(getitem, index)
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 762, in operate
return op(self.comparator, *other, **kwargs)
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/sqlalchemy/sql/operators.py", line 432, in __getitem__
return self.operate(getitem, index)
File "<string>", line 1, in <lambda>
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/sqlalchemy/sql/type_api.py", line 67, in operate
return o[0](self.expr, op, *(other + o[1:]), **kwargs)
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/sqlalchemy/sql/default_comparator.py", line 237, in _getitem_impl
_unsupported_impl(expr, op, other, **kw)
File "/root/neutron/.tox/py3/lib/python3.8/site-packages/sqlalchemy/sql/default_comparator.py", line 241, in _unsupported_impl
raise NotImplementedError(
NotImplementedError: Operator 'getitem' is not supported on this expression
neutron. tests.unit. objects. test_ports. PortBindingDbOb jectTestCase. test_get_ duplicated_ port_bindings fails on stable/xena with: rror: Operator 'getitem' is not supported on this expression
NotImplementedE
The code introduced in commit 2fb9ddb01ed44fa e19c0184baa8620 e95e51e344 [1] appears to depend on a sqlalchemy version that is higher than the minimum version specified in requirements.txt.
[1]
commit 2fb9ddb01ed44fa e19c0184baa8620 e95e51e344
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Mon Dec 12 05:10:01 2022 +0100
Delete the PB level registers when deleting the duplicated PB
The ``neutron- remove- duplicated- port-bindings` ` script removes the bindings" table) that
duplicated port binding registers ("ml2_port_
have status=INACTIVE.
This patch also removes the corresponding port binding levels port_binding_ levels" table) associated to those inactive port
("ml2_
bindings.
Closes-Bug: #2000078
Change-Id: I12fa0764cd0ff5 09f1859b61060d6 4cc5a54a7b9 2d8baaec099bf8b edfc837013) e187c76708a727b 8a4db1e2e2)
(cherry picked from commit 572185e1fd25277
(cherry picked from commit 07855a68266484a
To recreate:
root@f1:~/neutron# git remote -v /opendev. org/openstack/ neutron (fetch) /opendev. org/openstack/ neutron (push)
origin https:/
origin https:/
root@f1:~/neutron# git branch
* (HEAD detached at 19.7.0)
master
stable/xena
root@f1:~/neutron# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
root@f1:~/neutron# tox -e py3 --notest
...
py3: OK (22.37 seconds)
congratulations :) (22.46 seconds)
root@f1:~/neutron# .tox/py3/bin/pip3 freeze | grep -i -E 'oslo.db| sqlalchemy' migrate= =0.13.0
oslo.db==11.0.0
SQLAlchemy==1.4.23
sqlalchemy-
root@f1:~/neutron# grep -i -E 'oslo.db| sqlalchemy' requirements.txt
SQLAlchemy>=1.3.23 # MIT
oslo.db>=4.44.0 # Apache-2.0
root@f1:~/neutron# .tox/py3/bin/pip3 install oslo.db==4.44.0 SQLAlchemy==1.3.23
...
Successfully installed SQLAlchemy-1.3.23 oslo.db-4.44.0
root@f1:~/neutron# tox -e py3 -- neutron. tests.unit. objects. test_ports. PortBindingDbOb jectTestCase. test_get_ duplicated_ port_bindings tests.unit. objects. test_ports. PortBindingDbOb jectTestCase. test_get_ duplicated_ port_bindings [0.367953s] ... FAILED [117/27872]
...
{0} neutron.
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "/root/ neutron/ neutron/ tests/base. py", line 183, in func
return f(self, *args, **kwargs)
File "/root/ neutron/ neutron/ tests/unit/ objects/ test_ports. py", line 68, in test_get_ duplicated_ port_bindings ng.get_ duplicated_ port_bindings( self.context)
dup_pb = ports.PortBindi
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ oslo_db/ sqlalchemy/ enginefacade. py", line 1012, in wrapper
return fn(*args, **kwargs)
File "/root/ neutron/ neutron/ objects/ ports.py" , line 115, in get_duplicated_ port_bindings select( cls.db_ model.port_ id).
sqlalchemy.
File "<string>", line 2, in select
File "<string>", line 2, in __init__
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ sqlalchemy/ util/deprecatio ns.py", line 139, in warned
return fn(*args, **kwargs)
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ sqlalchemy/ sql/selectable. py", line 3114, in __init__
for c in columns:
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ sqlalchemy/ sql/operators. py", line 432, in __getitem__ getitem, index)
return self.operate(
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ sqlalchemy/ orm/attributes. py", line 226, in operate
return op(self.comparator, *other, **kwargs)
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ sqlalchemy/ sql/operators. py", line 432, in __getitem__ getitem, index)
return self.operate(
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ sqlalchemy/ orm/properties. py", line 367, in operate __clause_ element_ _(), *other, **kwargs)
return op(self.
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ sqlalchemy/ sql/operators. py", line 432, in __getitem__ getitem, index)
return self.operate(
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ sqlalchemy/ sql/elements. py", line 762, in operate
return op(self.comparator, *other, **kwargs)
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ sqlalchemy/ sql/operators. py", line 432, in __getitem__ getitem, index)
return self.operate(
File "<string>", line 1, in <lambda>
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ sqlalchemy/ sql/type_ api.py" , line 67, in operate
return o[0](self.expr, op, *(other + o[1:]), **kwargs)
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ sqlalchemy/ sql/default_ comparator. py", line 237, in _getitem_impl d_impl( expr, op, other, **kw)
_unsupporte
File "/root/ neutron/ .tox/py3/ lib/python3. 8/site- packages/ sqlalchemy/ sql/default_ comparator. py", line 241, in _unsupported_impl rror(
raise NotImplementedE
NotImplemen tedError: Operator 'getitem' is not supported on this expression