From 3ede373f281edb07141b7e8752670c16878eb909 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Fri, 2 Nov 2012 10:47:34 -0700 Subject: [PATCH] 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 (cherry picked from commit eedd98477dd3b8a5561d30732b7ccf71e9a7d428) --- nova/network/manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/network/manager.py b/nova/network/manager.py index 891fcbe9c89e..2306e0ca685c 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -608,7 +608,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: