Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

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