Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

@@ 1044-1055 (lines=12) @@
1041
        elif vlan_a == 0 and vlan_z == "4096/4096":
1042
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1043
1044
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1045
            flow_mod_za["actions"].insert(
1046
                    0, {"action_type": "set_vlan", "vlan_id": vlan_a}
1047
                )
1048
            if not vlan_z:
1049
                flow_mod_za["actions"].insert(
1050
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1051
                )
1052
            if vlan_z == 0:
1053
                flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1054
        elif vlan_a == "4096/4096" and vlan_z == 0:
1055
            flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1056
1057
        flows = []
1058
        if isinstance(vlan_a, list):
@@ 1031-1042 (lines=12) @@
1028
            self.queue_id, vlan_z
1029
        )
1030
1031
        if not isinstance(vlan_z, list) and vlan_z not in self.special_cases:
1032
            flow_mod_az["actions"].insert(
1033
                0, {"action_type": "set_vlan", "vlan_id": vlan_z}
1034
            )
1035
            if not vlan_a:
1036
                flow_mod_az["actions"].insert(
1037
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1038
                )
1039
            if vlan_a == 0:
1040
                flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1041
        elif vlan_a == 0 and vlan_z == "4096/4096":
1042
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1043
1044
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1045
            flow_mod_za["actions"].insert(