Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

@@ 981-992 (lines=12) @@
978
        elif vlan_a == 0 and vlan_z == "4096/4096":
979
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
980
981
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
982
            flow_mod_za["actions"].insert(
983
                    0, {"action_type": "set_vlan", "vlan_id": vlan_a}
984
                )
985
            if not vlan_z:
986
                flow_mod_za["actions"].insert(
987
                    0, {"action_type": "push_vlan", "tag_type": "c"}
988
                )
989
            if vlan_z == 0:
990
                flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
991
        elif vlan_a == "4096/4096" and vlan_z == 0:
992
            flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
993
994
        flows = []
995
        if isinstance(vlan_a, list):
@@ 968-979 (lines=12) @@
965
            self.queue_id, vlan_z
966
        )
967
968
        if not isinstance(vlan_z, list) and vlan_z not in self.special_cases:
969
            flow_mod_az["actions"].insert(
970
                0, {"action_type": "set_vlan", "vlan_id": vlan_z}
971
            )
972
            if not vlan_a:
973
                flow_mod_az["actions"].insert(
974
                    0, {"action_type": "push_vlan", "tag_type": "c"}
975
                )
976
            if vlan_a == 0:
977
                flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
978
        elif vlan_a == 0 and vlan_z == "4096/4096":
979
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
980
981
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
982
            flow_mod_za["actions"].insert(