Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

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