From fa650b4d8756cd5411c5861b396d16a9ebd310df Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Mon, 31 Dec 2012 14:46:51 +0000 Subject: Ensure that Quantum uses configured fixed IP Fixes bug 1094897 The fix ensures that the fixed IP address specified by the user is correctly passed to Quantum. That is, when the Quantum port is created it is created with the specified IP address. Change-Id: I8191ac2497037e2592b0679962e4606cd24d7844 --- nova/network/quantumv2/api.py | 3 ++- nova/tests/network/test_quantumv2.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nova/network/quantumv2/api.py b/nova/network/quantumv2/api.py index 3a20e1ed0..88431b91d 100644 --- a/nova/network/quantumv2/api.py +++ b/nova/network/quantumv2/api.py @@ -136,7 +136,8 @@ class API(base.Base): touched_port_ids.append(port['id']) else: if fixed_ips.get(network_id): - port_req_body['port']['fixed_ip'] = fixed_ip + port_req_body['port']['fixed_ips'] = [{'ip_address': + fixed_ip}] port_req_body['port']['network_id'] = network_id port_req_body['port']['admin_state_up'] = True port_req_body['port']['tenant_id'] = instance['project_id'] diff --git a/nova/tests/network/test_quantumv2.py b/nova/tests/network/test_quantumv2.py index 6cb0728a2..1eab23a03 100644 --- a/nova/tests/network/test_quantumv2.py +++ b/nova/tests/network/test_quantumv2.py @@ -399,7 +399,8 @@ class TestQuantumv2(test.TestCase): else: fixed_ip = fixed_ips.get(net_id) if fixed_ip: - port_req_body['port']['fixed_ip'] = fixed_ip + port_req_body['port']['fixed_ips'] = [{'ip_address': + fixed_ip}] port_req_body['port']['network_id'] = net_id port_req_body['port']['admin_state_up'] = True port_req_body['port']['tenant_id'] = \ -- cgit