Code Duplication    Length = 12-12 lines in 2 locations

models/evc.py 2 locations

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