summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2012-11-02 10:47:34 -0700
committerBrian Waldon <bcwaldon@gmail.com>2012-11-02 10:49:58 -0700
commiteedd98477dd3b8a5561d30732b7ccf71e9a7d428 (patch)
tree7f646f48f28caac005ef4051b1799fca1b281b70
parenta77c0c50166aac04f0707af25946557fbd43ad44 (diff)
downloadnova-eedd98477dd3b8a5561d30732b7ccf71e9a7d428.tar.gz
nova-eedd98477dd3b8a5561d30732b7ccf71e9a7d428.tar.xz
nova-eedd98477dd3b8a5561d30732b7ccf71e9a7d428.zip
Use elevated context in disassociate_floating_ip
The call to service_get_by_host_and_topic would raise AdminRequired in the case that a non-admin tried to disassociate a floating ip from their instance and multi_host was on. Using an elevated context for the db lookup enables the host lookup to happend and allows a user to disassociate their floating ips. Fixes bug 1074437 Change-Id: I3d47b5a48eae21ea913120bd00728a0b8132da81
-rw-r--r--nova/network/manager.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/network/manager.py b/nova/network/manager.py
index 0a42d8c61..afe79a664 100644
--- a/nova/network/manager.py
+++ b/nova/network/manager.py
@@ -589,7 +589,7 @@ class FloatingIP(object):
instance = self.db.instance_get_by_uuid(context,
fixed_ip['instance_uuid'])
service = self.db.service_get_by_host_and_topic(
- context, instance['host'], 'network')
+ context.elevated(), instance['host'], 'network')
if service and utils.service_is_up(service):
host = instance['host']
else: