Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

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