Skip to content

Commit 03ed557

Browse files
authored
Merge pull request #70 from stackhpc/upstream/yoga-2023-10-23
Synchronise yoga with upstream
2 parents bdb697f + 7dbd06d commit 03ed557

File tree

8 files changed

+68
-23
lines changed

8 files changed

+68
-23
lines changed

neutron/common/ovn/extensions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from neutron_lib.api.definitions import auto_allocated_topology
1919
from neutron_lib.api.definitions import availability_zone as az_def
2020
from neutron_lib.api.definitions import default_subnetpools
21+
from neutron_lib.api.definitions import dhcpagentscheduler
2122
from neutron_lib.api.definitions import dns
2223
from neutron_lib.api.definitions import dns_domain_keywords
2324
from neutron_lib.api.definitions import dns_domain_ports
@@ -106,6 +107,7 @@
106107
portbindings.ALIAS,
107108
pbe_ext.ALIAS,
108109
default_subnetpools.ALIAS,
110+
dhcpagentscheduler.ALIAS,
109111
dns.ALIAS,
110112
external_net.ALIAS,
111113
extra_dhcp_opt.ALIAS,

neutron/db/address_group_db.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def get_address_group(self, context, id, fields=None):
168168
def get_address_groups(self, context, filters=None, fields=None,
169169
sorts=None, limit=None, marker=None,
170170
page_reverse=False):
171+
filters = filters or {}
171172
pager = base_obj.Pager(sorts, limit, page_reverse, marker)
172173
address_groups = ag_obj.AddressGroup.get_objects(
173174
context, _pager=pager, **filters)

neutron/plugins/ml2/drivers/linuxbridge/agent/arp_protect.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ def _delete_vif_mac_rules(vif, current_rules):
201201
chain = _mac_chain_name(vif)
202202
for rule in current_rules:
203203
if '-i %s' % vif in rule and '--among-src' in rule:
204-
ebtables(['-D', chain] + rule.split())
204+
# Flush the table and recreate the default DROP rule.
205+
ebtables(['-F', chain])
206+
ebtables(['-A', chain, '-j', 'DROP'])
205207

206208

207209
def _delete_mac_spoofing_protection(vifs, current_rules, table, chain):

neutron/plugins/ml2/plugin.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,18 +1619,17 @@ def create_port_bulk(self, context, ports):
16191619
for port in port_list:
16201620
self._before_create_port(context, port)
16211621

1622-
port_list, net_cache = self.allocate_macs_and_ips_for_ports(
1623-
context, port_list)
1624-
16251622
try:
1623+
port_list, net_cache = self.allocate_macs_and_ips_for_ports(
1624+
context, port_list)
16261625
return self._create_port_bulk(context, port_list, net_cache)
16271626
except Exception:
16281627
with excutils.save_and_reraise_exception():
16291628
# If any issue happened allocated IP addresses needs to be
16301629
# deallocated now
16311630
for port in port_list:
16321631
self.ipam.deallocate_ips_from_port(
1633-
context, port, port['ipams'])
1632+
context, port, port.get('ipams'))
16341633

16351634
@db_api.retry_if_session_inactive()
16361635
def _create_port_bulk(self, context, port_list, network_cache):

neutron/tests/unit/plugins/ml2/test_plugin.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
from neutron.db import provisioning_blocks
5656
from neutron.db import securitygroups_db as sg_db
5757
from neutron.db import segments_db
58+
from neutron.ipam import driver
5859
from neutron.objects import base as base_obj
5960
from neutron.objects import ports as port_obj
6061
from neutron.objects import router as l3_obj
@@ -1737,6 +1738,39 @@ def test_create_ports_bulk_with_extra_dhcp_opts(self):
17371738
ports_out = self.plugin.create_port_bulk(ctx, ports_in)
17381739
self.assertEqual(edo, ports_out[0]['extra_dhcp_opts'])
17391740

1741+
def test_create_ports_bulk_with_wrong_fixed_ips(self):
1742+
cidr = '10.0.10.0/24'
1743+
with self.network() as net:
1744+
with self.subnet(net, cidr=cidr) as snet:
1745+
net_id = net['network']['id']
1746+
data = [{'network_id': net_id,
1747+
'fixed_ips': [{'subnet_id': snet['subnet']['id'],
1748+
'ip_address': '10.0.10.100'}],
1749+
'tenant_id': snet['subnet']['tenant_id']
1750+
},
1751+
{'network_id': net_id,
1752+
'fixed_ips': [{'subnet_id': snet['subnet']['id'],
1753+
'ip_address': '10.0.20.101'}],
1754+
'tenant_id': snet['subnet']['tenant_id']
1755+
}]
1756+
res = self._create_bulk_from_list(self.fmt, 'port',
1757+
data, as_admin=True)
1758+
self.assertEqual(webob.exc.HTTPBadRequest.code, res.status_int)
1759+
self.assertIn('IP address 10.0.20.101 is not a valid IP for '
1760+
'the specified subnet.',
1761+
res.json['NeutronError']['message'])
1762+
1763+
ipam_driver = driver.Pool.get_instance(None, self.context)
1764+
ipam_allocator = ipam_driver.get_allocator([cidr])
1765+
with db_api.CONTEXT_READER.using(self.context):
1766+
ipam_subnet = ipam_allocator._driver.get_subnet(
1767+
snet['subnet']['id'])
1768+
allocations = ipam_subnet.subnet_manager.list_allocations(
1769+
self.context)
1770+
# There are no leftovers (e.g.: 10.0.10.100) in the
1771+
# "IpamAllocation" registers
1772+
self.assertEqual([], allocations)
1773+
17401774
def test_delete_port_no_notify_in_disassociate_floatingips(self):
17411775
ctx = context.get_admin_context()
17421776
plugin = directory.get_plugin()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
During the port bulk creation, if an IPAM allocation fails (for example, if
5+
the IP address is outside of the subnet CIDR), the other IPAM allocations
6+
already created are deleted before raising the exception. Fixes bug
7+
`2039550 <https://launchpad.net/bugs/2039550>`_.

zuul.d/tempest-multinode.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
vars:
4040
tox_envlist: integrated-network
4141
devstack_localrc:
42-
CIRROS_VERSION: 0.5.1
43-
DEFAULT_IMAGE_NAME: cirros-0.5.1-x86_64-uec
44-
DEFAULT_IMAGE_FILE_NAME: cirros-0.5.1-x86_64-uec.tar.gz
42+
CIRROS_VERSION: 0.5.2
43+
DEFAULT_IMAGE_NAME: cirros-0.5.2-x86_64-uec
44+
DEFAULT_IMAGE_FILE_NAME: cirros-0.5.2-x86_64-uec.tar.gz
4545
Q_ML2_TENANT_NETWORK_TYPE: vxlan
4646
Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch,linuxbridge
4747
Q_AGENT: openvswitch
@@ -172,9 +172,9 @@
172172
vars:
173173
tox_envlist: integrated-network
174174
devstack_localrc:
175-
CIRROS_VERSION: 0.5.1
176-
DEFAULT_IMAGE_NAME: cirros-0.5.1-x86_64-uec
177-
DEFAULT_IMAGE_FILE_NAME: cirros-0.5.1-x86_64-uec.tar.gz
175+
CIRROS_VERSION: 0.5.2
176+
DEFAULT_IMAGE_NAME: cirros-0.5.2-x86_64-uec
177+
DEFAULT_IMAGE_FILE_NAME: cirros-0.5.2-x86_64-uec.tar.gz
178178
Q_ML2_TENANT_NETWORK_TYPE: vxlan
179179
Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch,linuxbridge
180180
Q_AGENT: openvswitch
@@ -266,9 +266,9 @@
266266
devstack_plugins:
267267
neutron: https://opendev.org/openstack/neutron.git
268268
devstack_localrc:
269-
CIRROS_VERSION: 0.5.1
270-
DEFAULT_IMAGE_NAME: cirros-0.5.1-x86_64-uec
271-
DEFAULT_IMAGE_FILE_NAME: cirros-0.5.1-x86_64-uec.tar.gz
269+
CIRROS_VERSION: 0.5.2
270+
DEFAULT_IMAGE_NAME: cirros-0.5.2-x86_64-uec
271+
DEFAULT_IMAGE_FILE_NAME: cirros-0.5.2-x86_64-uec.tar.gz
272272
Q_ML2_TENANT_NETWORK_TYPE: vxlan
273273
Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch,linuxbridge
274274
Q_AGENT: openvswitch
@@ -383,9 +383,9 @@
383383
ovn:
384384
enable_distributed_floating_ip: True
385385
devstack_localrc:
386-
CIRROS_VERSION: 0.5.1
387-
DEFAULT_IMAGE_NAME: cirros-0.5.1-x86_64-uec
388-
DEFAULT_IMAGE_FILE_NAME: cirros-0.5.1-x86_64-uec.tar.gz
386+
CIRROS_VERSION: 0.5.2
387+
DEFAULT_IMAGE_NAME: cirros-0.5.2-x86_64-uec
388+
DEFAULT_IMAGE_FILE_NAME: cirros-0.5.2-x86_64-uec.tar.gz
389389
Q_AGENT: ovn
390390
ML2_L3_PLUGIN: ovn-router,trunk
391391
Q_ML2_PLUGIN_MECHANISM_DRIVERS: ovn,logger

zuul.d/tempest-singlenode.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,9 @@
339339
neutron_plugin_options:
340340
is_igmp_snooping_enabled: True
341341
devstack_localrc:
342-
CIRROS_VERSION: 0.5.1
343-
DEFAULT_IMAGE_NAME: cirros-0.5.1-x86_64-uec
344-
DEFAULT_IMAGE_FILE_NAME: cirros-0.5.1-x86_64-uec.tar.gz
342+
CIRROS_VERSION: 0.5.2
343+
DEFAULT_IMAGE_NAME: cirros-0.5.2-x86_64-uec
344+
DEFAULT_IMAGE_FILE_NAME: cirros-0.5.2-x86_64-uec.tar.gz
345345
Q_AGENT: ovn
346346
ML2_L3_PLUGIN: ovn-router,trunk
347347
Q_ML2_PLUGIN_MECHANISM_DRIVERS: ovn,logger
@@ -448,9 +448,9 @@
448448
vars:
449449
tox_envlist: integrated-network
450450
devstack_localrc:
451-
CIRROS_VERSION: 0.5.1
452-
DEFAULT_IMAGE_NAME: cirros-0.5.1-x86_64-uec
453-
DEFAULT_IMAGE_FILE_NAME: cirros-0.5.1-x86_64-uec.tar.gz
451+
CIRROS_VERSION: 0.5.2
452+
DEFAULT_IMAGE_NAME: cirros-0.5.2-x86_64-uec
453+
DEFAULT_IMAGE_FILE_NAME: cirros-0.5.2-x86_64-uec.tar.gz
454454
devstack_plugins:
455455
neutron: https://opendev.org/openstack/neutron.git
456456
devstack_services:

0 commit comments

Comments
 (0)