If you enter a command line of:
python3 scan.py update
The code breaks on scan.py line 139. The reason, the variable "active_groups" is assumed to be a dictionary, and it is when the name of the group is pulled from the db, but when you supply it from the command line, it is a list. Thus, the call to "active_groups.keys()" fails and kills the app.
The following is the code with some surrounding context:
if mode == 'backfill':
result = [executor.submit(backfill, active_group, date, target) for active_group, target in active_groups.items()]
else:
###################################################
# THE FOLLOWING IS THE PROBLEM LINE
result = [executor.submit(update, active_group) for active_group in active_groups.keys()]
###################################################
for r in concurrent.futures.as_completed(result):
data.append(r.result())
If you enter a command line of: python3 scan.py update
The code breaks on scan.py line 139. The reason, the variable "active_groups" is assumed to be a dictionary, and it is when the name of the group is pulled from the db, but when you supply it from the command line, it is a list. Thus, the call to "active_groups.keys()" fails and kills the app.
The following is the code with some surrounding context: