summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Kotton <gkotton@redhat.com>2012-12-31 14:46:51 +0000
committerGary Kotton <gkotton@redhat.com>2012-12-31 15:24:07 +0000
commitfa650b4d8756cd5411c5861b396d16a9ebd310df (patch)
tree2162909bf0138550dcc029a5b5af13ea9bf5be92
parentb8b8f2032483e5f3d6c09b7b6fddd07301805230 (diff)
downloadnova-fa650b4d8756cd5411c5861b396d16a9ebd310df.tar.gz
nova-fa650b4d8756cd5411c5861b396d16a9ebd310df.tar.xz
nova-fa650b4d8756cd5411c5861b396d16a9ebd310df.zip
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
-rw-r--r--nova/network/quantumv2/api.py3
-rw-r--r--nova/tests/network/test_quantumv2.py3
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'] = \