Skip to content

Commit

Permalink
Merge "Call get_instance_nw_info with elevated context, as documented…
Browse files Browse the repository at this point in the history
… in nova/network/manager.py"
  • Loading branch information
Jenkins authored and openstack-gerrit committed Dec 16, 2011
2 parents effb5a3 + 59193f1 commit 106ea5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nova/compute/api.py
Expand Up @@ -1555,7 +1555,7 @@ def associate_floating_ip(self, context, instance, address):
# 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])
Expand Down
3 changes: 2 additions & 1 deletion nova/tests/test_compute.py
Expand Up @@ -1868,7 +1868,8 @@ def fake_associate_ip_network_api(self, ctxt, floating_address,

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',
Expand Down

0 comments on commit 106ea5e

Please sign in to comment.