Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

@@ 1117-1128 (lines=12) @@
1114
        elif vlan_a == 0 and vlan_z == "4096/4096":
1115
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1116
1117
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1118
            flow_mod_za["actions"].insert(
1119
                    0, {"action_type": "set_vlan", "vlan_id": vlan_a}
1120
                )
1121
            if not vlan_z:
1122
                flow_mod_za["actions"].insert(
1123
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1124
                )
1125
            if vlan_z == 0:
1126
                flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1127
        elif vlan_a == "4096/4096" and vlan_z == 0:
1128
            flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1129
1130
        flows = []
1131
        if isinstance(vlan_a, list):
@@ 1104-1115 (lines=12) @@
1101
            self.queue_id, vlan_z
1102
        )
1103
1104
        if not isinstance(vlan_z, list) and vlan_z not in self.special_cases:
1105
            flow_mod_az["actions"].insert(
1106
                0, {"action_type": "set_vlan", "vlan_id": vlan_z}
1107
            )
1108
            if not vlan_a:
1109
                flow_mod_az["actions"].insert(
1110
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1111
                )
1112
            if vlan_a == 0:
1113
                flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1114
        elif vlan_a == 0 and vlan_z == "4096/4096":
1115
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1116
1117
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1118
            flow_mod_za["actions"].insert(