diff options
| author | Troy Toman <troy.toman@rackspace.com> | 2012-07-13 17:22:23 -0500 |
|---|---|---|
| committer | Troy Toman <troy.toman@rackspace.com> | 2012-07-13 17:24:37 -0500 |
| commit | 4e7bb008effe92a4e06a2d104cbd1ea0d19a5db6 (patch) | |
| tree | 92c5c8aaff98b143631234867281e48c7a1eeefe | |
| parent | 38beedcb13b839b3d2b87e53cab5198b211ba65b (diff) | |
| download | nova-4e7bb008effe92a4e06a2d104cbd1ea0d19a5db6.tar.gz nova-4e7bb008effe92a4e06a2d104cbd1ea0d19a5db6.tar.xz nova-4e7bb008effe92a4e06a2d104cbd1ea0d19a5db6.zip | |
bug 1024557
De-dupes the list of DNS IPs that is put in the xenstore for network configuration
Added a duplicate DNS IP in the fake_network to create a valid test.
Change-Id: I25a00c7e47578b1667992aa4bad879667198465a
| -rw-r--r-- | nova/tests/fake_network.py | 1 | ||||
| -rw-r--r-- | nova/tests/test_xenapi.py | 2 | ||||
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/nova/tests/fake_network.py b/nova/tests/fake_network.py index 5391da417..b120dc9b1 100644 --- a/nova/tests/fake_network.py +++ b/nova/tests/fake_network.py @@ -174,6 +174,7 @@ def fake_network(network_id, ipv6=None): 'broadcast': '192.168.%d.255' % network_id, 'dns1': '192.168.%d.3' % network_id, 'dns2': '192.168.%d.4' % network_id, + 'dns3': '192.168.%d.3' % network_id, 'vlan': None, 'host': None, 'project_id': 'fake_project', diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index f05ea9e5b..e1e360416 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -435,7 +435,7 @@ class XenAPIVMTestCase(stubs.XenAPITestBase): tcpip_data = ast.literal_eval(xenstore_value) self.assertEquals(tcpip_data, {'broadcast': '192.168.1.255', - 'dns': ['192.168.1.3', '192.168.1.4'], + 'dns': ['192.168.1.4', '192.168.1.3'], 'gateway': '192.168.1.1', 'gateway_v6': 'fe80::def', 'ip6s': [{'enabled': '1', diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index f9958ff4c..687ec0b65 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -1265,7 +1265,7 @@ class VMOps(object): info_dict['routes'] = routes if dns: - info_dict['dns'] = dns + info_dict['dns'] = list(set(dns)) return info_dict |
