diff options
| author | Dan Wendlandt <dan@nicira.com> | 2013-03-19 16:53:25 -0700 |
|---|---|---|
| committer | Dan Wendlandt <dan@nicira.com> | 2013-03-19 16:53:25 -0700 |
| commit | b9a3e798dcb474bd733cb7a92219ec186831ae0c (patch) | |
| tree | 85ec1c363ba2d78b2b7e731491ed4ecfd570999c | |
| parent | f041d153f4594925c7c061e25cada50451e9c28c (diff) | |
fix add-fixed-ip with quantum
bug 1157439
code was ignoring existing IPs on a port when adding a new IP.
Change-Id: I11f3c81eafc6c7d44772c3c8aea3b14f4b6bc815
| -rw-r--r-- | nova/network/quantumv2/api.py | 3 | ||||
| -rw-r--r-- | 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 48fac7c82..d3a94aa49 100644 --- a/nova/network/quantumv2/api.py +++ b/nova/network/quantumv2/api.py @@ -383,7 +383,8 @@ class API(base.Base): ports = data['ports'] for p in ports: for subnet in ipam_subnets: - fixed_ips = [{'subnet_id': subnet['id']}] + fixed_ips = p['fixed_ips'] + fixed_ips.append({'subnet_id': subnet['id']}) port_req_body = {'port': {'fixed_ips': fixed_ips}} try: quantumv2.get_client(context).update_port(p['id'], diff --git a/nova/tests/network/test_quantumv2.py b/nova/tests/network/test_quantumv2.py index 660123866..420de821b 100644 --- a/nova/tests/network/test_quantumv2.py +++ b/nova/tests/network/test_quantumv2.py @@ -1137,7 +1137,8 @@ class TestQuantumv2(test.TestCase): **search_opts).AndReturn({'ports': self.port_data1}) port_req_body = { 'port': { - 'fixed_ips': [{'subnet_id': 'my_subid1'}], + 'fixed_ips': [{'subnet_id': 'my_subid1'}, + {'subnet_id': 'my_subid1'}], }, } port = self.port_data1[0] |
