diff options
| author | Joseph W. Breu <breu@breu.org> | 2012-11-15 14:25:50 -0600 |
|---|---|---|
| committer | Joseph W. Breu <breu@breu.org> | 2012-11-15 16:40:10 -0600 |
| commit | 1b455923446de6fcfee7166059db72b80ff51dfe (patch) | |
| tree | e368b70351ab3bab74109165a64b7307dff8632a | |
| parent | beacd8b668fc5aaef5ee49677add1dde49582b92 (diff) | |
Fix use_single_default_gateway
With FlatDHCP and use_single_default_gateway nova-network creates
an invalid entry in the dnsmasq .opts file for the network that
contains a blank router option. New instances will not receive
a default gateway.
Change-Id: I4c2da61def0681b7b253ae387bf83c069484e28b
Fixes: bug #1075859
| -rw-r--r-- | nova/network/linux_net.py | 1 | ||||
| -rw-r--r-- | nova/tests/network/test_linux_net.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py index 994a3c0f4..ca5a70a5b 100644 --- a/nova/network/linux_net.py +++ b/nova/network/linux_net.py @@ -756,6 +756,7 @@ def get_dhcp_opts(context, network_ref): default_gw_vif[instance_uuid] = vifs[0]['id'] for datum in data: + instance_uuid = datum['instance_uuid'] if instance_uuid in default_gw_vif: # we don't want default gateway for this fixed ip if default_gw_vif[instance_uuid] != datum['vif_id']: diff --git a/nova/tests/network/test_linux_net.py b/nova/tests/network/test_linux_net.py index aaf29601a..c4b99e3e5 100644 --- a/nova/tests/network/test_linux_net.py +++ b/nova/tests/network/test_linux_net.py @@ -307,7 +307,7 @@ class LinuxNetworkTestCase(test.TestCase): self.assertEquals(actual_hosts, expected) def test_get_dhcp_opts_for_nw00(self): - expected_opts = 'NW-0,3\nNW-3,3\nNW-4,3' + expected_opts = 'NW-3,3\nNW-4,3' actual_opts = self.driver.get_dhcp_opts(self.context, networks[0]) self.assertEquals(actual_opts, expected_opts) |
