Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

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