Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

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