Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

@@ 1001-1012 (lines=12) @@
998
        elif vlan_a == 0 and vlan_z == "4096/4096":
999
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1000
1001
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1002
            flow_mod_za["actions"].insert(
1003
                    0, {"action_type": "set_vlan", "vlan_id": vlan_a}
1004
                )
1005
            if not vlan_z:
1006
                flow_mod_za["actions"].insert(
1007
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1008
                )
1009
            if vlan_z == 0:
1010
                flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1011
        elif vlan_a == "4096/4096" and vlan_z == 0:
1012
            flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1013
1014
        flows = []
1015
        if isinstance(vlan_a, list):
@@ 988-999 (lines=12) @@
985
            self.queue_id, vlan_z
986
        )
987
988
        if not isinstance(vlan_z, list) and vlan_z not in self.special_cases:
989
            flow_mod_az["actions"].insert(
990
                0, {"action_type": "set_vlan", "vlan_id": vlan_z}
991
            )
992
            if not vlan_a:
993
                flow_mod_az["actions"].insert(
994
                    0, {"action_type": "push_vlan", "tag_type": "c"}
995
                )
996
            if vlan_a == 0:
997
                flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
998
        elif vlan_a == 0 and vlan_z == "4096/4096":
999
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1000
1001
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1002
            flow_mod_za["actions"].insert(