summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2013-01-07 10:55:26 -0800
committerVishvananda Ishaya <vishvananda@gmail.com>2013-01-15 13:24:58 -0800
commitbdc4860866c432ff4be899ffc444f38efd9e371b (patch)
tree06a5e39be92c7e2b8fab4c7729ab52edcb4f2f3c /nova
parent34ffd41831ee6b6e629a5f5c2e52c2729f00029d (diff)
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
Diffstat (limited to 'nova')
-rw-r--r--nova/network/manager.py7
1 files 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():