From dd0e0ad5942743a434adf36bb91d107ac4e484e9 Mon Sep 17 00:00:00 2001 From: Jason Kölker Date: Thu, 5 Jul 2012 11:21:13 -0500 Subject: Allow network_uuids that begin with a prefix * If the bare network_uuid is not uuid-like, attempt to validate with the first 'prefix-' stripped off * Fix LP1021370 Change-Id: I4914d4ffcb633aef1c5b7f8abfa0b48eaf4f0cc9 --- nova/tests/api/openstack/compute/test_servers.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/api/openstack/compute/test_servers.py b/nova/tests/api/openstack/compute/test_servers.py index ca5efe6c3..5b9fdc3d2 100644 --- a/nova/tests/api/openstack/compute/test_servers.py +++ b/nova/tests/api/openstack/compute/test_servers.py @@ -119,6 +119,12 @@ class ServersControllerTest(test.TestCase): fake_network.stub_out_nw_api_get_instance_nw_info(self.stubs, spectacular=True) + def test_requested_networks_prefix(self): + uuid = 'br-00000000-0000-0000-0000-000000000000' + requested_networks = [{'uuid': uuid}] + res = self.controller._get_requested_networks(requested_networks) + self.assertTrue((uuid, None) in res) + def test_get_server_by_uuid(self): req = fakes.HTTPRequest.blank('/v2/fake/servers/%s' % FAKE_UUID) res_dict = self.controller.show(req, FAKE_UUID) -- cgit