From 249a775b9600b26e86c7ceab05fee6a4260e3325 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Sat, 27 Jan 2018 02:28:05 +0000 Subject: [PATCH 1/2] [minigraph.py] Only add 'service' field to control plane ACLs, not dataplane ACLs --- src/sonic-config-engine/minigraph.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 0dc3085e1294..23d02a363e47 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -202,15 +202,14 @@ def parse_dpg(dpg, hname): if acl_intfs: acls[aclname] = {'policy_desc': aclname, 'ports': acl_intfs, - 'type': 'MIRROR' if is_mirror else 'L3', - 'service': 'N/A'} + 'type': 'MIRROR' if is_mirror else 'L3'} else: # This ACL has no interfaces to attach to -- consider this a control plane ACL aclservice = aclintf.find(str(QName(ns, "Type"))).text acls[aclname] = {'policy_desc': aclname, 'ports': acl_intfs, 'type': 'CTRLPLANE', - 'service': aclservice if aclservice is not None else ''} + 'service': aclservice if aclservice is not None else 'UNKNOWN'} return intfs, lo_intfs, mgmt_intf, vlans, vlan_members, pcs, acls return None, None, None, None, None, None, None From 35ede69c18f10dd1db327e8e176b641b18957719 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Sat, 27 Jan 2018 02:47:37 +0000 Subject: [PATCH 2/2] Modify unit test accordingly --- src/sonic-config-engine/tests/test_cfggen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 768052a1d7e2..2eee6fe331c8 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -73,7 +73,7 @@ def test_render_template(self): def test_minigraph_acl(self): argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v ACL_TABLE' output = self.run_script(argument) - self.assertEqual(output.strip(), "{'DATAACL': {'type': 'L3', 'policy_desc': 'DATAACL', 'service': 'N/A', 'ports': ['Ethernet112', 'Ethernet116', 'Ethernet120', 'Ethernet124']}}") + self.assertEqual(output.strip(), "{'DATAACL': {'type': 'L3', 'policy_desc': 'DATAACL', 'ports': ['Ethernet112', 'Ethernet116', 'Ethernet120', 'Ethernet124']}}") def test_minigraph_everflow(self): argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v MIRROR_SESSION'