Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

@@ 1100-1111 (lines=12) @@
1097
        elif vlan_a == 0 and vlan_z == "4096/4096":
1098
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1099
1100
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1101
            flow_mod_za["actions"].insert(
1102
                    0, {"action_type": "set_vlan", "vlan_id": vlan_a}
1103
                )
1104
            if not vlan_z:
1105
                flow_mod_za["actions"].insert(
1106
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1107
                )
1108
            if vlan_z == 0:
1109
                flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1110
        elif vlan_a == "4096/4096" and vlan_z == 0:
1111
            flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1112
1113
        flows = []
1114
        if isinstance(vlan_a, list):
@@ 1087-1098 (lines=12) @@
1084
            self.queue_id, vlan_z
1085
        )
1086
1087
        if not isinstance(vlan_z, list) and vlan_z not in self.special_cases:
1088
            flow_mod_az["actions"].insert(
1089
                0, {"action_type": "set_vlan", "vlan_id": vlan_z}
1090
            )
1091
            if not vlan_a:
1092
                flow_mod_az["actions"].insert(
1093
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1094
                )
1095
            if vlan_a == 0:
1096
                flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1097
        elif vlan_a == 0 and vlan_z == "4096/4096":
1098
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1099
1100
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1101
            flow_mod_za["actions"].insert(