Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

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