Code Duplication    Length = 14-14 lines in 2 locations

scripts/vlan_pool.py 1 location

@@ 197-210 (lines=14) @@
194
        print("There is nothing to update or add")
195
196
197
if __name__ == "__main__":
198
    mongo = Mongo()
199
    cmds = {
200
        "aggregate_outdated_interfaces": aggregate_outdated_interfaces,
201
        "update_database": update_database,
202
    }
203
    try:
204
        cmd = os.environ["CMD"]
205
        cmds[cmd](mongo)
206
    except KeyError:
207
        print(
208
            f"Please set the 'CMD' env var. \nIt has to be one of these: {list(cmds.keys())}"
209
        )
210
        sys.exit(1)
211

scripts/special_vlan_allocation.py 1 location

@@ 96-109 (lines=14) @@
93
        print("All interfaces are updated already.")
94
95
96
if __name__ == "__main__":
97
    mongo = Mongo()
98
    cmds = {
99
        "aggregate_outdated_interfaces": aggregate_outdated_interfaces,
100
        "update_database": update_database,
101
    }
102
    try:
103
        cmd = os.environ["CMD"]
104
        cmds[cmd](mongo)
105
    except KeyError:
106
        print(
107
            f"Please set the 'CMD' env var. \nIt has to be one of these: {list(cmds.keys())}"
108
        )
109
        sys.exit(1)
110