From 60b3d3fbd12f62fd2077401c12112fc48c886246 Mon Sep 17 00:00:00 2001 From: Stanislaw Pitucha Date: Fri, 30 Sep 2011 15:50:29 +0100 Subject: [PATCH] Use new ip addr del syntax Start appending the /32 suffix to the addresses when removing floating IPs. Fixes bug 865371. Change-Id: I77df5748ba5417b7474a90e641ecc8adc76921c2 --- nova/network/linux_net.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py index 19d7b5cf7335..e5d22bd1b89c 100755 --- a/nova/network/linux_net.py +++ b/nova/network/linux_net.py @@ -403,7 +403,7 @@ def init_host(): def bind_floating_ip(floating_ip, check_exit_code=True): """Bind ip to public interface.""" - _execute('ip', 'addr', 'add', floating_ip, + _execute('ip', 'addr', 'add', str(floating_ip) + '/32', 'dev', FLAGS.public_interface, run_as_root=True, check_exit_code=check_exit_code) if FLAGS.send_arp_for_ha: @@ -414,7 +414,7 @@ def bind_floating_ip(floating_ip, check_exit_code=True): def unbind_floating_ip(floating_ip): """Unbind a public ip from public interface.""" - _execute('ip', 'addr', 'del', floating_ip, + _execute('ip', 'addr', 'del', str(floating_ip) + '/32', 'dev', FLAGS.public_interface, run_as_root=True)