Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

@@ 1030-1041 (lines=12) @@
1027
        elif vlan_a == 0 and vlan_z == "4096/4096":
1028
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1029
1030
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1031
            flow_mod_za["actions"].insert(
1032
                    0, {"action_type": "set_vlan", "vlan_id": vlan_a}
1033
                )
1034
            if not vlan_z:
1035
                flow_mod_za["actions"].insert(
1036
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1037
                )
1038
            if vlan_z == 0:
1039
                flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1040
        elif vlan_a == "4096/4096" and vlan_z == 0:
1041
            flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1042
1043
        flows = []
1044
        if isinstance(vlan_a, list):
@@ 1017-1028 (lines=12) @@
1014
            self.queue_id, vlan_z
1015
        )
1016
1017
        if not isinstance(vlan_z, list) and vlan_z not in self.special_cases:
1018
            flow_mod_az["actions"].insert(
1019
                0, {"action_type": "set_vlan", "vlan_id": vlan_z}
1020
            )
1021
            if not vlan_a:
1022
                flow_mod_az["actions"].insert(
1023
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1024
                )
1025
            if vlan_a == 0:
1026
                flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1027
        elif vlan_a == 0 and vlan_z == "4096/4096":
1028
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1029
1030
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1031
            flow_mod_za["actions"].insert(