diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 625e11c012..e0a8b3bd79 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -993,7 +993,6 @@ def parse_meta(meta, hname): dhcp_servers = [] dhcpv6_servers = [] ntp_servers = [] - dns_nameservers = [] tacacs_servers = [] mgmt_routes = [] erspan_dst = [] @@ -1024,8 +1023,6 @@ def parse_meta(meta, hname): dhcp_servers = value_group elif name == "NtpResources": ntp_servers = value_group - elif name == "DnsNameserverResources": - dns_nameservers = value_group elif name == "SyslogResources": syslog_servers = value_group elif name == "TacacsServer": @@ -1064,7 +1061,7 @@ def parse_meta(meta, hname): qos_profile = value elif name == "RackMgmtMap": rack_mgmt_map = value - return syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, dns_nameservers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, switch_id, switch_type, max_cores, kube_data, macsec_profile, downstream_redundancy_types, redundancy_type, qos_profile, rack_mgmt_map + return syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, switch_id, switch_type, max_cores, kube_data, macsec_profile, downstream_redundancy_types, redundancy_type, qos_profile, rack_mgmt_map def parse_linkmeta(meta, hname): @@ -1491,7 +1488,6 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw dhcp_servers = [] dhcpv6_servers = [] ntp_servers = [] - dns_nameservers = [] tacacs_servers = [] mgmt_routes = [] erspan_dst = [] @@ -1547,7 +1543,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw elif child.tag == str(QName(ns, "UngDec")): (u_neighbors, u_devices, _, _, _, _, _, _) = parse_png(child, hostname, None) elif child.tag == str(QName(ns, "MetadataDeclaration")): - (syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, dns_nameservers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, switch_id, switch_type, max_cores, kube_data, macsec_profile, downstream_redundancy_types, redundancy_type, qos_profile, rack_mgmt_map) = parse_meta(child, hostname) + (syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, switch_id, switch_type, max_cores, kube_data, macsec_profile, downstream_redundancy_types, redundancy_type, qos_profile, rack_mgmt_map) = parse_meta(child, hostname) elif child.tag == str(QName(ns, "LinkMetadataDeclaration")): linkmetas = parse_linkmeta(child, hostname) elif child.tag == str(QName(ns, "DeviceInfos")): @@ -2003,7 +1999,6 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw results['DHCP_SERVER'] = dict((item, {}) for item in dhcp_servers) results['DHCP_RELAY'] = dhcp_relay_table results['NTP_SERVER'] = dict((item, {}) for item in ntp_servers) - results['DNS_NAMESERVER'] = dict((item, {}) for item in dns_nameservers) results['TACPLUS_SERVER'] = dict((item, {'priority': '1', 'tcp_port': '49'}) for item in tacacs_servers) if len(acl_table_types) > 0: results['ACL_TABLE_TYPE'] = acl_table_types diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml b/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml index 0adcec5c84..be3938f24b 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml +++ b/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml @@ -1425,11 +1425,6 @@ 17.39.1.129;17.39.1.130 - - DnsNameserverResources - - 1.1.1.1;8.8.8.8 - SnmpResources diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case.xml b/src/sonic-config-engine/tests/simple-sample-graph-case.xml index 7e8f1579cd..69b27c33e7 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case.xml @@ -500,12 +500,6 @@ 10.0.10.1;10.0.10.2 - - DnsNameserverResources - - 1.1.1.1;8.8.8.8 - - SnmpResources diff --git a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml index c841ff8d1a..fbc33b4986 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml @@ -236,12 +236,6 @@ 10.0.10.1;10.0.10.2 - - DnsNameserverResources - - 20.2.2.2;30.3.3.3 - - SnmpResources diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 9c1c56d28f..b84d5acdc5 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -696,11 +696,6 @@ class TestCfgGen(TestCase): output = self.run_script(argument) self.assertEqual(utils.to_dict(output.strip()), utils.to_dict("{'10.0.10.1': {}, '10.0.10.2': {}}")) - def test_metadata_dns_nameserver(self): - argument = ['-m', self.sample_graph_metadata, '-p', self.port_config, '-v', "DNS_NAMESERVER"] - output = self.run_script(argument) - self.assertEqual(utils.to_dict(output.strip()), utils.to_dict("{'20.2.2.2': {}, '30.3.3.3': {}}")) - def test_minigraph_vnet(self, **kwargs): graph_file = kwargs.get('graph_file', self.sample_graph_simple) argument = ['-m', graph_file, '-p', self.port_config, '-v', "VNET"] diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index 035cff6edb..d33d2c14e8 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -277,11 +277,6 @@ class TestCfgGenCaseInsensitive(TestCase): output = self.run_script(argument) self.assertEqual(output.strip(), "{'10.0.10.1': {}, '10.0.10.2': {}}") - def test_metadata_dns_nameserver(self): - argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', "DNS_NAMESERVER"] - output = self.run_script(argument) - self.assertEqual(output.strip(), "{'1.1.1.1': {}, '8.8.8.8': {}}") - def test_minigraph_vnet(self): argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', "VNET"] output = self.run_script(argument) diff --git a/src/sonic-config-engine/tests/test_multinpu_cfggen.py b/src/sonic-config-engine/tests/test_multinpu_cfggen.py index 7026dfa84a..bc4227f85d 100644 --- a/src/sonic-config-engine/tests/test_multinpu_cfggen.py +++ b/src/sonic-config-engine/tests/test_multinpu_cfggen.py @@ -150,17 +150,6 @@ class TestMultiNpuCfgGen(TestCase): print("Log:asic{} sku {}".format(asic,output)) self.assertDictEqual(output, {}) - def test_metadata_dns_nameserver(self): - argument = ['-m', self.sample_graph, '-p', self.sample_port_config, '--var-json', "DNS_NAMESERVER"] - output = json.loads(self.run_script(argument)) - self.assertDictEqual(output, {'1.1.1.1': {}, '8.8.8.8': {}}) - #DNS_NAMESERVER data is present only in the host config - argument = ['-m', self.sample_graph, '--var-json', "DNS_NAMESERVER"] - for asic in range(NUM_ASIC): - output = json.loads(self.run_script_for_asic(argument, asic, self.port_config[asic])) - print("Log:asic{} sku {}".format(asic,output)) - self.assertDictEqual(output, {}) - def test_mgmt_port(self): argument = ['-m', self.sample_graph, '-p', self.sample_port_config, '--var-json', "MGMT_PORT"] output = json.loads(self.run_script(argument))