diff options
| author | Jenkins <jenkins@review.openstack.org> | 2011-12-16 22:46:48 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2011-12-16 22:46:48 +0000 |
| commit | 106ea5eda8458b44846207a3df69cf1837789828 (patch) | |
| tree | de9701bd30b5898e8dee37851005bc8330c491d1 | |
| parent | effb5a38333598877e7f54a8ac1b110fffadae4c (diff) | |
| parent | 59193f110875026453b69ba0fc51f10692268875 (diff) | |
Merge "Call get_instance_nw_info with elevated context, as documented in nova/network/manager.py"
| -rw-r--r-- | nova/compute/api.py | 2 | ||||
| -rw-r--r-- | nova/tests/test_compute.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index e939de62c..0fd55f97d 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1555,7 +1555,7 @@ class API(base.Base): # accommodate the info containing floating as well as fixed ip # addresses fixed_ip_addrs = [] - for info in self.network_api.get_instance_nw_info(context, + for info in self.network_api.get_instance_nw_info(context.elevated(), instance): ips = info[1]['ips'] fixed_ip_addrs.extend([ip_dict['ip'] for ip_dict in ips]) diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py index b70f444e9..b01344463 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', |
