Running cloudmapper.py report then causes this exception:
Traceback (most recent call last):
File "cloudmapper.py", line 72, in <module>
main()
File "cloudmapper.py", line 66, in main
commands[command].run(arguments)
File "/opt/cloudmapper/commands/report.py", line 471, in run
report(accounts, config, args)
File "/opt/cloudmapper/commands/report.py", line 263, in report
public_nodes, _ = get_public_nodes(account, config, use_cache=True)
File "/opt/cloudmapper/shared/public.py", line 89, in get_public_nodes
network = build_data_structure(account, config, outputfilter)
File "/opt/cloudmapper/commands/prepare.py", line 542, in build_data_structure
for cidr in get_external_cidrs(account, config):
File "/opt/cloudmapper/commands/prepare.py", line 198, in get_external_cidrs
external_cidrs.append(Cidr(cidr, get_cidr_name(cidr, config)))
File "/opt/cloudmapper/commands/prepare.py", line 203, in get_cidr_name
return config["cidrs"].get(cidr, {}).get("name", None)
AttributeError: 'list' object has no attribute 'get'
After a bit of debugging I realised my config is wrong, since cloudmapper.py expects a dict for cidrs. Could some validation, e.g. JSON schemas, be added to the configuration when it is loaded?
I had a
config.json
with the following:Running
cloudmapper.py report
then causes this exception:After a bit of debugging I realised my config is wrong, since
cloudmapper.py
expects a dict forcidrs
. Could some validation, e.g. JSON schemas, be added to the configuration when it is loaded?