From 4856c92dec6b1f853d51aa0908c28d89b452e049 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Fri, 16 Dec 2011 19:07:30 +0000 Subject: [PATCH] Call get_instance_nw_info with elevated context, as documented in nova/network/manager.py * Fixes Bug 904976 * Add coverage for this in associate_floating_ip unit test Change-Id: I5bc35632ca382d011eb42e738140ba54d9cdc93f --- nova/tests/test_compute.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py index b70f444e..b0134446 100644 --- a/nova/tests/test_compute.py +++ b/nova/tests/test_compute.py @@ -1868,7 +1868,8 @@ class ComputeAPITestCase(BaseTestCase): nw_info = fake_network.fake_get_instance_nw_info(self.stubs, 1) - def fake_get_nw_info(self, ctxt, instance): + def fake_get_nw_info(cls, ctxt, instance): + self.assertTrue(ctxt.is_admin) return nw_info self.stubs.Set(nova.network.API, 'associate_floating_ip',