From bdc4860866c432ff4be899ffc444f38efd9e371b Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 7 Jan 2013 10:55:26 -0800 Subject: Override floating interface on callee side We allow individual nodes to override the floating interface by setting public_interface=XXX on the node. Unfortunately in multi_host an associate or disassociate call can be forwarded from one host to another. Currently the override happens on the caller side instead of the callee side. This fixes the issue by moving the override. Fixes bug 1096987 Change-Id: I37fbbf9e0ee0ffbe8c8754649301371b98da9f4f --- nova/network/manager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nova/network/manager.py b/nova/network/manager.py index ccdac6f60..7b69c7a36 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -568,7 +568,7 @@ class FloatingIP(object): else: host = network['host'] - interface = CONF.public_interface or floating_ip['interface'] + interface = floating_ip.get('interface') if host == self.host: # i'm the correct host self._associate_floating_ip(context, floating_address, @@ -585,6 +585,7 @@ class FloatingIP(object): def _associate_floating_ip(self, context, floating_address, fixed_address, interface, instance_uuid): """Performs db and driver calls to associate floating ip & fixed ip.""" + interface = CONF.public_interface or interface @lockutils.synchronized(unicode(floating_address), 'nova-') def do_associate(): @@ -642,7 +643,7 @@ class FloatingIP(object): # send to correct host, unless i'm the correct host network = self._get_network_by_id(context, fixed_ip['network_id']) - interface = CONF.public_interface or floating_ip['interface'] + interface = floating_ip.get('interface') if network['multi_host']: instance = self.db.instance_get_by_uuid(context, fixed_ip['instance_uuid']) @@ -672,7 +673,7 @@ class FloatingIP(object): def _disassociate_floating_ip(self, context, address, interface, instance_uuid): """Performs db and driver calls to disassociate floating ip.""" - # disassociate floating ip + interface = CONF.public_interface or interface @lockutils.synchronized(unicode(address), 'nova-') def do_disassociate(): -- cgit