Remove super old br-<uuid> neutron network id compat code
This removes some really old compat code from when what was originally neutron (quantum) would allow network ids with a br- prefix for some reason. If I had to guess I'd guess it was some rackspace quirk. Anyway, with the neutron network data model [1] the id field is restricted to 36 characters [2][3] so br-<uuid> isn't going to happen in reality so we can drop this old compat code. [1] https://opendev.org/openstack/neutron/src/tag/15.0.0/neutron/db/models_v2.py#L255 [2] https://opendev.org/openstack/neutron-lib/src/tag/1.29.1/neutron_lib/db/model_base.py#L68 [3] https://opendev.org/openstack/neutron-lib/src/tag/1.29.1/neutron_lib/db/constants.py#L20 Change-Id: I58411a40c7d2b0d7f50b8d9c29c748438b1e1420
This commit is contained in:
parent
f28839b523
commit
42e65eea6c
|
@ -389,11 +389,6 @@ class ServersController(wsgi.Controller):
|
||||||
:raises: webob.exc.HTTPBadRequest if validation fails
|
:raises: webob.exc.HTTPBadRequest if validation fails
|
||||||
"""
|
"""
|
||||||
if not uuidutils.is_uuid_like(net_id):
|
if not uuidutils.is_uuid_like(net_id):
|
||||||
# NOTE(mriedem): Neutron would allow a network id with a br- prefix
|
|
||||||
# back in Folsom so continue to honor that.
|
|
||||||
# TODO(mriedem): Need to figure out if this is still a valid case.
|
|
||||||
br_uuid = net_id.split('-', 1)[-1]
|
|
||||||
if not uuidutils.is_uuid_like(br_uuid):
|
|
||||||
msg = _("Bad networks format: network uuid is "
|
msg = _("Bad networks format: network uuid is "
|
||||||
"not in proper format (%s)") % net_id
|
"not in proper format (%s)") % net_id
|
||||||
raise exc.HTTPBadRequest(explanation=msg)
|
raise exc.HTTPBadRequest(explanation=msg)
|
||||||
|
|
|
@ -302,11 +302,17 @@ class ServersControllerTest(ControllerTest):
|
||||||
self.assertIsNotNone(ctxt.db_connection)
|
self.assertIsNotNone(ctxt.db_connection)
|
||||||
|
|
||||||
def test_requested_networks_prefix(self):
|
def test_requested_networks_prefix(self):
|
||||||
|
"""Tests that we no longer support the legacy br-<uuid> format for
|
||||||
|
a network id.
|
||||||
|
"""
|
||||||
self.flags(use_neutron=True)
|
self.flags(use_neutron=True)
|
||||||
uuid = 'br-00000000-0000-0000-0000-000000000000'
|
uuid = 'br-00000000-0000-0000-0000-000000000000'
|
||||||
requested_networks = [{'uuid': uuid}]
|
requested_networks = [{'uuid': uuid}]
|
||||||
res = self.controller._get_requested_networks(requested_networks)
|
ex = self.assertRaises(webob.exc.HTTPBadRequest,
|
||||||
self.assertIn((uuid, None, None, None), res.as_tuples())
|
self.controller._get_requested_networks,
|
||||||
|
requested_networks)
|
||||||
|
self.assertIn('Bad networks format: network uuid is not in proper '
|
||||||
|
'format', six.text_type(ex))
|
||||||
|
|
||||||
def test_requested_networks_neutronv2_enabled_with_port(self):
|
def test_requested_networks_neutronv2_enabled_with_port(self):
|
||||||
self.flags(use_neutron=True)
|
self.flags(use_neutron=True)
|
||||||
|
|
Loading…
Reference in New Issue