Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

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