Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

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