We're dieing from netaddr exceptions and so on, e.g. if we define a route_check with dest=0.0.0.0/k, we die with:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/capi/netforeman/netforeman/cli.py", line 94, in <module>
sys.exit(main())
File "/home/capi/netforeman/netforeman/cli.py", line 81, in main
dispatcher = dispatch.Dispatch(args.config_file)
File "/home/capi/netforeman/netforeman/dispatch.py", line 50, in __init__
ok = self.config.load_modules()
File "/home/capi/netforeman/netforeman/config.py", line 182, in load_modules
settings = API.settings_from_pyhocon(config_tree, self)
File "/home/capi/netforeman/netforeman/config.py", line 65, in settings_from_pyhocon
return cls._SettingsClass.from_pyhocon(conf, configurator)
File "/home/capi/netforeman/netforeman/fibinterface.py", line 284, in from_pyhocon
for subconf in conf.get_list('route_checks', default=[])
File "/home/capi/netforeman/netforeman/fibinterface.py", line 284, in <listcomp>
for subconf in conf.get_list('route_checks', default=[])
File "/home/capi/netforeman/netforeman/fibinterface.py", line 248, in from_pyhocon
dest = netaddr.IPNetwork(cls._get_conf(conf, 'dest'))
File "/usr/lib/python3/dist-packages/netaddr/ip/__init__.py", line 933, in __init__
raise AddrFormatError('invalid IPNetwork %s' % addr)
netaddr.core.AddrFormatError: invalid IPNetwork 0.0.0.0/k
We should catch these kinds of errors, and convert them to a config.ParseError.
We're dieing from netaddr exceptions and so on, e.g. if we define a
route_check
withdest=0.0.0.0/k
, we die with:We should catch these kinds of errors, and convert them to a
config.ParseError
.