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
This commit is contained in:
3 changed files with 3 additions and 2 deletions
@@ -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',
@@ -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',
@@ -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
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.