Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

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