Hi Kirk,,
I followed your document of "Introduction to nornir' and facing the issues on nornir with windows OS.
The debugger logs :
c:\users\tkmamja.pycharmce2019.1\venv\scripts\lpthw\test\ktbyers\hey\heyhey.py(1)()
-> from nornir import InitNornir
(Pdb) n
c:\users\tkmamja.pycharmce2019.1\venv\scripts\lpthw\test\ktbyers\hey\heyhey.py(3)()
-> nr = InitNornir()
(Pdb) p nr
*** NameError: name 'nr' is not defined
(Pdb) p
*** SyntaxError: unexpected EOF while parsing
(Pdb) p nr
*** NameError: name 'nr' is not defined
(Pdb) n
ruamel.yaml.scanner.ScannerError: mapping values are not allowed in this context
in "hosts.yaml", line 2, column 5
c:\users\tkmamja.pycharmce2019.1\venv\scripts\lpthw\test\ktbyers\hey\heyhey.py(3)()
-> nr = InitNornir()
(Pdb) n
--Return--
c:\users\tkmamja.pycharmce2019.1\venv\scripts\lpthw\test\ktbyers\hey\heyhey.py(3)()->None
-> nr = InitNornir()
(Pdb) n
ruamel.yaml.scanner.ScannerError: mapping values are not allowed in this context
in "hosts.yaml", line 2, column 5
(1)()->None
(Pdb) p nr.inventory.hosts
*** NameError: name 'nr' is not defined
(Pdb) exit
When I ran the program I get this :
$ python heyhey.py
Traceback (most recent call last):
File "heyhey.py", line 5, in
nr = InitNornir()
File "C:\Users\TKMAMJA.PyCharmCE2019.1\venv\lib\site-packages\nornir\init_nornir.py", line 78, in InitNornir
**conf.inventory.options,
File "C:\Users\TKMAMJA.PyCharmCE2019.1\venv\lib\site-packages\nornir\core\deserializer\inventory.py", line 129, in deserialize
deserialized = cls(*args, **kwargs)
File "C:\Users\TKMAMJA.PyCharmCE2019.1\venv\lib\site-packages\nornir\plugins\inventory\simple.py", line 55, in init
super().init(hosts=hosts, groups=groups, defaults=defaults, *args, **kwargs)
File "C:\Users\TKMAMJA.PyCharmCE2019.1\venv\lib\site-packages\pydantic\main.py", line 142, in init
self.setstate(self._process_values(data))
File "C:\Users\TKMAMJA.PyCharmCE2019.1\venv\lib\site-packages\pydantic\main.py", line 312, in _process_values
return validate_model(self, input_data)
File "C:\Users\TKMAMJA.PyCharmCE2019.1\venv\lib\site-packages\pydantic\main.py", line 474, in validate_model
raise ValidationError(errors)
pydantic.error_wrappers.ValidationError: 4 validation errors
hosts -> rtr1 -> nornir_host
extra fields not permitted (type=value_error.extra)
groups -> defaults -> nornir_password
extra fields not permitted (type=value_error.extra)
groups -> defaults -> nornir_username
extra fields not permitted (type=value_error.extra)
groups -> cisco_ios -> nornir_nos
extra fields not permitted (type=value_error.extra)
What am I doing wrong here?????????? Could be great help.
Hi Kirk,,
I followed your document of "Introduction to nornir' and facing the issues on nornir with windows OS.
The debugger logs :
c:\users\tkmamja.pycharmce2019.1\venv\scripts\lpthw\test\ktbyers\hey\heyhey.py(1)()
-> from nornir import InitNornir
(Pdb) n
When I ran the program I get this :
$ python heyhey.py
Traceback (most recent call last):
File "heyhey.py", line 5, in
nr = InitNornir()
File "C:\Users\TKMAMJA.PyCharmCE2019.1\venv\lib\site-packages\nornir\init_nornir.py", line 78, in InitNornir
**conf.inventory.options,
File "C:\Users\TKMAMJA.PyCharmCE2019.1\venv\lib\site-packages\nornir\core\deserializer\inventory.py", line 129, in deserialize
deserialized = cls(*args, **kwargs)
File "C:\Users\TKMAMJA.PyCharmCE2019.1\venv\lib\site-packages\nornir\plugins\inventory\simple.py", line 55, in init
super().init(hosts=hosts, groups=groups, defaults=defaults, *args, **kwargs)
File "C:\Users\TKMAMJA.PyCharmCE2019.1\venv\lib\site-packages\pydantic\main.py", line 142, in init
self.setstate(self._process_values(data))
File "C:\Users\TKMAMJA.PyCharmCE2019.1\venv\lib\site-packages\pydantic\main.py", line 312, in _process_values
return validate_model(self, input_data)
File "C:\Users\TKMAMJA.PyCharmCE2019.1\venv\lib\site-packages\pydantic\main.py", line 474, in validate_model
raise ValidationError(errors)
pydantic.error_wrappers.ValidationError: 4 validation errors
hosts -> rtr1 -> nornir_host
extra fields not permitted (type=value_error.extra)
groups -> defaults -> nornir_password
extra fields not permitted (type=value_error.extra)
groups -> defaults -> nornir_username
extra fields not permitted (type=value_error.extra)
groups -> cisco_ios -> nornir_nos
extra fields not permitted (type=value_error.extra)
What am I doing wrong here?????????? Could be great help.