Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

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