Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

@@ 971-982 (lines=12) @@
968
        elif vlan_a == 0 and vlan_z == "4096/4096":
969
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
970
971
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
972
            flow_mod_za["actions"].insert(
973
                    0, {"action_type": "set_vlan", "vlan_id": vlan_a}
974
                )
975
            if not vlan_z:
976
                flow_mod_za["actions"].insert(
977
                    0, {"action_type": "push_vlan", "tag_type": "c"}
978
                )
979
            if vlan_z == 0:
980
                flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
981
        elif vlan_a == "4096/4096" and vlan_z == 0:
982
            flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
983
984
        flows = []
985
        if isinstance(vlan_a, list):
@@ 958-969 (lines=12) @@
955
            self.queue_id, vlan_z
956
        )
957
958
        if not isinstance(vlan_z, list) and vlan_z not in self.special_cases:
959
            flow_mod_az["actions"].insert(
960
                0, {"action_type": "set_vlan", "vlan_id": vlan_z}
961
            )
962
            if not vlan_a:
963
                flow_mod_az["actions"].insert(
964
                    0, {"action_type": "push_vlan", "tag_type": "c"}
965
                )
966
            if vlan_a == 0:
967
                flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
968
        elif vlan_a == 0 and vlan_z == "4096/4096":
969
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
970
971
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
972
            flow_mod_za["actions"].insert(