Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

@@ 1056-1067 (lines=12) @@
1053
        elif vlan_a == 0 and vlan_z == "4096/4096":
1054
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1055
1056
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1057
            flow_mod_za["actions"].insert(
1058
                    0, {"action_type": "set_vlan", "vlan_id": vlan_a}
1059
                )
1060
            if not vlan_z:
1061
                flow_mod_za["actions"].insert(
1062
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1063
                )
1064
            if vlan_z == 0:
1065
                flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1066
        elif vlan_a == "4096/4096" and vlan_z == 0:
1067
            flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1068
1069
        flows = []
1070
        if isinstance(vlan_a, list):
@@ 1043-1054 (lines=12) @@
1040
            self.queue_id, vlan_z
1041
        )
1042
1043
        if not isinstance(vlan_z, list) and vlan_z not in self.special_cases:
1044
            flow_mod_az["actions"].insert(
1045
                0, {"action_type": "set_vlan", "vlan_id": vlan_z}
1046
            )
1047
            if not vlan_a:
1048
                flow_mod_az["actions"].insert(
1049
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1050
                )
1051
            if vlan_a == 0:
1052
                flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1053
        elif vlan_a == 0 and vlan_z == "4096/4096":
1054
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1055
1056
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1057
            flow_mod_za["actions"].insert(