Hitting a bug where os_name is None after it goes through validation.
(venv) axians@ubuntu-automation:~/netcfgbu$ netcfgbu login
Traceback (most recent call last):
File "/home/axians/netcfgbu/venv/bin/netcfgbu", line 7, in <module>
exec(compile(f.read(), __file__, 'exec'))
File "/home/axians/netcfgbu/bin/netcfgbu", line 6, in <module>
main.run()
File "/home/axians/netcfgbu/netcfgbu/cli/main.py", line 11, in run
cli(obj={})
File "/home/axians/netcfgbu/venv/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/axians/netcfgbu/venv/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/axians/netcfgbu/venv/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/axians/netcfgbu/netcfgbu/cli/root.py", line 66, in invoke
super().invoke(ctx)
File "/home/axians/netcfgbu/venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/axians/netcfgbu/venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/axians/netcfgbu/venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/axians/netcfgbu/netcfgbu/cli/login.py", line 84, in cli_login
exec_test_login(ctx.obj["app_cfg"], ctx.obj["inventory_recs"], cli_opts)
File "/home/axians/netcfgbu/netcfgbu/cli/login.py", line 25, in exec_test_login
login_tasks = {
File "/home/axians/netcfgbu/netcfgbu/cli/login.py", line 26, in <dictcomp>
make_host_connector(rec, app_cfg).test_login(timeout=cli_opts["timeout"]): rec
File "/home/axians/netcfgbu/netcfgbu/os_specs/__init__.py", line 11, in make_host_connector
os_spec_def = get_os_spec(rec, app_cfg)
File "/home/axians/netcfgbu/netcfgbu/os_specs/__init__.py", line 7, in get_os_spec
return app_cfg.os_name.get(os_name) or OSNameSpec()
AttributeError: 'NoneType' object has no attribute 'get'
Jeremy found the issue within config_model.py whereby v needed to be returned on line 162.
Cheers for looking into this issue @jeremyschulman.
Hitting a bug where os_name is None after it goes through validation.
Jeremy found the issue within
config_model.py
wherebyv
needed to be returned on line 162.Cheers for looking into this issue @jeremyschulman.