Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

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