Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

@@ 1137-1148 (lines=12) @@
1134
        elif vlan_a == 0 and vlan_z == "4096/4096":
1135
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1136
1137
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1138
            flow_mod_za["actions"].insert(
1139
                    0, {"action_type": "set_vlan", "vlan_id": vlan_a}
1140
                )
1141
            if not vlan_z:
1142
                flow_mod_za["actions"].insert(
1143
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1144
                )
1145
            if vlan_z == 0:
1146
                flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1147
        elif vlan_a == "4096/4096" and vlan_z == 0:
1148
            flow_mod_az["actions"].insert(0, {"action_type": "pop_vlan"})
1149
1150
        flows = []
1151
        if isinstance(vlan_a, list):
@@ 1124-1135 (lines=12) @@
1121
            self.queue_id, vlan_z
1122
        )
1123
1124
        if not isinstance(vlan_z, list) and vlan_z not in self.special_cases:
1125
            flow_mod_az["actions"].insert(
1126
                0, {"action_type": "set_vlan", "vlan_id": vlan_z}
1127
            )
1128
            if not vlan_a:
1129
                flow_mod_az["actions"].insert(
1130
                    0, {"action_type": "push_vlan", "tag_type": "c"}
1131
                )
1132
            if vlan_a == 0:
1133
                flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1134
        elif vlan_a == 0 and vlan_z == "4096/4096":
1135
            flow_mod_za["actions"].insert(0, {"action_type": "pop_vlan"})
1136
1137
        if not isinstance(vlan_a, list) and vlan_a not in self.special_cases:
1138
            flow_mod_za["actions"].insert(