Skip to content

Commit 06e4b67

Browse files
authored
Merge pull request #49 from stackhpc/upstream/yoga-2023-06-19
Synchronise yoga with upstream
2 parents 5b40de7 + d3dc53d commit 06e4b67

File tree

17 files changed

+101
-35
lines changed

17 files changed

+101
-35
lines changed

doc/source/ovn/migration.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ Perform the following steps in the undercloud
155155
server that will be used as a NFS server to store the backup.
156156
Default: 192.168.24.1
157157

158+
* BACKUP_MIGRATION_CTL_PLANE_CIDRS - Only used if CREATE_BACKUP is enabled.
159+
A comma separated string of control plane subnets in CIDR notation for the
160+
controllers being backed up. The specified subnets will be used to enable
161+
NFS remote clients connections.
162+
Default: 192.168.24.0/24
163+
158164
.. warning::
159165

160166
Please note that VALIDATE_MIGRATION requires enough quota (2

neutron/agent/metadata/driver.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,6 @@ def spawn_monitored_metadata_proxy(cls, monitor, ns_name, port, conf,
255255
bind_address="0.0.0.0", network_id=None,
256256
router_id=None, bind_address_v6=None,
257257
bind_interface=None):
258-
uuid = network_id or router_id
259-
callback = cls._get_metadata_proxy_callback(
260-
bind_address, port, conf,
261-
network_id=network_id, router_id=router_id,
262-
bind_address_v6=bind_address_v6, bind_interface=bind_interface)
263-
pm = cls._get_metadata_proxy_process_manager(uuid, conf,
264-
ns_name=ns_name,
265-
callback=callback)
266258
if bind_interface is not None and bind_address_v6 is not None:
267259
# HAProxy cannot bind() until IPv6 Duplicate Address Detection
268260
# completes. We must wait until the address leaves its 'tentative'
@@ -290,7 +282,18 @@ def spawn_monitored_metadata_proxy(cls, monitor, ns_name, port, conf,
290282
except Exception as exc:
291283
# do not re-raise a delete failure, just log
292284
LOG.info('Address deletion failure: %s', str(exc))
293-
return
285+
286+
# Do not use the address or interface when DAD fails
287+
bind_address_v6 = bind_interface = None
288+
289+
uuid = network_id or router_id
290+
callback = cls._get_metadata_proxy_callback(
291+
bind_address, port, conf,
292+
network_id=network_id, router_id=router_id,
293+
bind_address_v6=bind_address_v6, bind_interface=bind_interface)
294+
pm = cls._get_metadata_proxy_process_manager(uuid, conf,
295+
ns_name=ns_name,
296+
callback=callback)
294297
pm.enable()
295298
monitor.register(uuid, METADATA_SERVICE_NAME, pm)
296299
cls.monitors[router_id] = pm

neutron/db/models/address_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ class AddressGroup(standard_attr.HasStandardAttributes,
4646
cascade='all, delete-orphan')
4747
rbac_entries = sa.orm.relationship(rbac_db_models.AddressGroupRBAC,
4848
backref='address_groups',
49-
lazy='subquery',
49+
lazy='joined',
5050
cascade='all, delete, delete-orphan')
5151
api_collections = [ag.ALIAS]

neutron/db/models/address_scope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ class AddressScope(model_base.BASEV2, model_base.HasId, model_base.HasProject):
3737

3838
rbac_entries = sa.orm.relationship(rbac_db_models.AddressScopeRBAC,
3939
backref='address_scopes',
40-
lazy='subquery',
40+
lazy='joined',
4141
cascade='all, delete, delete-orphan')

neutron/db/models/securitygroup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SecurityGroup(standard_attr.HasStandardAttributes, model_base.BASEV2,
3434
nullable=False)
3535
rbac_entries = sa.orm.relationship(rbac_db_models.SecurityGroupRBAC,
3636
backref='security_group',
37-
lazy='subquery',
37+
lazy='joined',
3838
cascade='all, delete, delete-orphan')
3939
api_collections = [sg.SECURITYGROUPS]
4040
collection_resource_map = {sg.SECURITYGROUPS: 'security_group'}

neutron/db/models_v2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ class Subnet(standard_attr.HasStandardAttributes, model_base.BASEV2,
228228
# subnets don't have their own rbac_entries, they just inherit from
229229
# the network rbac entries
230230
rbac_entries = orm.relationship(
231-
rbac_db_models.NetworkRBAC, lazy='subquery', uselist=True,
231+
rbac_db_models.NetworkRBAC, lazy='joined', uselist=True,
232232
foreign_keys='Subnet.network_id',
233233
primaryjoin='Subnet.network_id==NetworkRBAC.object_id',
234234
viewonly=True)
@@ -282,7 +282,7 @@ class SubnetPool(standard_attr.HasStandardAttributes, model_base.BASEV2,
282282
lazy='subquery')
283283
rbac_entries = sa.orm.relationship(rbac_db_models.SubnetPoolRBAC,
284284
backref='subnetpools',
285-
lazy='subquery',
285+
lazy='joined',
286286
cascade='all, delete, delete-orphan')
287287
api_collections = [subnetpool_def.COLLECTION_NAME]
288288
collection_resource_map = {subnetpool_def.COLLECTION_NAME:
@@ -304,7 +304,7 @@ class Network(standard_attr.HasStandardAttributes, model_base.BASEV2,
304304
rbac_entries = orm.relationship(rbac_db_models.NetworkRBAC,
305305
backref=orm.backref('network',
306306
load_on_pending=True),
307-
lazy='subquery',
307+
lazy='joined',
308308
cascade='all, delete, delete-orphan')
309309
availability_zone_hints = sa.Column(sa.String(255))
310310
mtu = sa.Column(sa.Integer, nullable=False,

neutron/db/qos/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class QosPolicy(standard_attr.HasStandardAttributes, model_base.BASEV2,
2929
__tablename__ = 'qos_policies'
3030
name = sa.Column(sa.String(db_const.NAME_FIELD_SIZE))
3131
rbac_entries = sa.orm.relationship(rbac_db_models.QosPolicyRBAC,
32-
backref='qos_policy', lazy='subquery',
32+
backref='qos_policy', lazy='joined',
3333
cascade='all, delete, delete-orphan')
3434
api_collections = ['policies']
3535
collection_resource_map = {'policies': 'policy'}

neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,10 @@ def sync_networks_ports_and_dhcp_opts(self, ctx):
10281028
except RuntimeError:
10291029
LOG.warning("Create network in OVN NB failed for "
10301030
"network %s", network['id'])
1031+
except n_exc.IpAddressGenerationFailure:
1032+
LOG.warning("No more IP addresses available during "
1033+
"implicit port creation while creating "
1034+
"network %s", network['id'])
10311035

10321036
self._sync_metadata_ports(ctx, db_ports)
10331037

neutron/tests/unit/agent/metadata/test_driver.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,12 @@ def _test_spawn_metadata_proxy(self, dad_failed=False):
176176
"%s.conf" % router_id)
177177
mock_open = self.useFixture(
178178
lib_fixtures.OpenFixture(cfg_file)).mock_open
179+
bind_v6_line = 'bind %s:%s interface %s' % (
180+
self.METADATA_DEFAULT_IPV6, self.METADATA_PORT, 'fake-if')
179181
if dad_failed:
180182
mock_wait.side_effect = ip_lib.DADFailed(
181-
address=self.METADATA_DEFAULT_IP, reason='DAD failed')
183+
address=self.METADATA_DEFAULT_IPV6, reason='DAD failed')
184+
bind_v6_line = ''
182185
else:
183186
mock_wait.return_value = True
184187
agent.metadata_driver.spawn_monitored_metadata_proxy(
@@ -197,8 +200,6 @@ def _test_spawn_metadata_proxy(self, dad_failed=False):
197200

198201
log_tag = ("haproxy-" + metadata_driver.METADATA_SERVICE_NAME +
199202
"-" + router_id)
200-
bind_v6_line = 'bind %s:%s interface %s' % (
201-
self.METADATA_DEFAULT_IPV6, self.METADATA_PORT, 'fake-if')
202203
cfg_contents = metadata_driver._HAPROXY_CONFIG_TEMPLATE % {
203204
'user': self.EUNAME,
204205
'group': self.EGNAME,
@@ -214,26 +215,26 @@ def _test_spawn_metadata_proxy(self, dad_failed=False):
214215
'bind_v6_line': bind_v6_line}
215216

216217
if dad_failed:
217-
agent.process_monitor.register.assert_not_called()
218218
mock_del.assert_called_once_with(self.METADATA_DEFAULT_IPV6,
219219
'fake-if',
220220
namespace=router_ns)
221221
else:
222-
mock_open.assert_has_calls([
223-
mock.call(cfg_file, 'w'),
224-
mock.call().write(cfg_contents)], any_order=True)
225-
226-
ip_mock.assert_has_calls([
227-
mock.call(namespace=router_ns),
228-
mock.call().netns.execute(netns_execute_args,
229-
addl_env=None, run_as_root=True)
230-
])
231-
232-
agent.process_monitor.register.assert_called_once_with(
233-
router_id, metadata_driver.METADATA_SERVICE_NAME,
234-
mock.ANY)
235222
mock_del.assert_not_called()
236223

224+
mock_open.assert_has_calls([
225+
mock.call(cfg_file, 'w'),
226+
mock.call().write(cfg_contents)], any_order=True)
227+
228+
ip_mock.assert_has_calls([
229+
mock.call(namespace=router_ns),
230+
mock.call().netns.execute(netns_execute_args, addl_env=None,
231+
run_as_root=True)
232+
])
233+
234+
agent.process_monitor.register.assert_called_once_with(
235+
router_id, metadata_driver.METADATA_SERVICE_NAME,
236+
mock.ANY)
237+
237238
def test_spawn_metadata_proxy(self):
238239
self._test_spawn_metadata_proxy()
239240

neutron/tests/unit/objects/test_address_group.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class AddressGroupRBACDbObjectTestCase(test_rbac.TestRBACObjectMixin,
5858
testlib_api.SqlTestCase):
5959

6060
_test_class = address_group.AddressGroupRBAC
61+
_parent_class = address_group.AddressGroup
6162

6263
def setUp(self):
6364
super(AddressGroupRBACDbObjectTestCase, self).setUp()

0 commit comments

Comments
 (0)