Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

@@ 1013-1024 (lines=12) @@
1010
        elif vlan_a == 0 and vlan_z == "4096/4096":
1011
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1012
1013
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1014
            flow_mod_za["actions"].insert(
1015
                    0, {"action_type": "set_vlan", "vlan_id": vlan_a}
1016
                )
1017
            if not vlan_z:
1018
                flow_mod_za["actions"].insert(
1019
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1020
                )
1021
            if vlan_z == 0:
1022
                flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1023
        elif vlan_a == "4096/4096" and vlan_z == 0:
1024
            flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1025
1026
        flows = []
1027
        if isinstance(vlan_a, list):
@@ 1000-1011 (lines=12) @@
997
            self.queue_id, vlan_z
998
        )
999
1000
        if not isinstance(vlan_z, list) and vlan_z not in self.special_cases:
1001
            flow_mod_az["actions"].insert(
1002
                0, {"action_type": "set_vlan", "vlan_id": vlan_z}
1003
            )
1004
            if not vlan_a:
1005
                flow_mod_az["actions"].insert(
1006
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1007
                )
1008
            if vlan_a == 0:
1009
                flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1010
        elif vlan_a == 0 and vlan_z == "4096/4096":
1011
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1012
1013
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1014
            flow_mod_za["actions"].insert(