Customized CSV plugin

Dear Gents, I am making a customized CSV plugin which should get data from CSV file instead of yaml file and getting the following exception? Can anyone help me in fixing this issue? Any help would be much appreciated!


Traceback (most recent call last):e[0m
e[0m File “C:\Users\user\AppData\Local\Programs\Python\Python38\inventory\”, line 67, in
e[0me[0m File “C:\Users\user\AppData\Local\Programs\Python\Python38\inventory\”, line 47, in main
nr = InitNornir(inventory={
e[0me[0m File “C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\nornir\”, line 74, in InitNornir
inv = conf.inventory.plugin.deserialize(
e[0me[0m File “C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\nornir\core\deserializer\”, line 146, in deserialize
return inventory.Inventory(
e[0me[0m File “C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\nornir\core\”, line 408, in init
host.groups.refs = [self.groups[p] for p in host.groups]
e[0me[0m File “C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\nornir\core\”, line 408, in
host.groups.refs = [self.groups[p] for p in host.groups]
e[0me[0mKeyError: ‘ericsson_mw’

GitHub link below to check all the needed files

'groups': [device_info[11]]
you assign a group ericsson_mw, but later this group is not created: groups = {}
You can’t assign a host to a nonexistent group.

Thanks brother, Issue is fixed…

There was one more minor issue and i have managed to fix it!

Thanks for your support in fixing this issue!

hi @khurram703 im new to nornir and automation/python. I’m also trying to use a csv plugin for my host following your code but I couldnt make it to work. What was the minor issue that you had and how did you fix it? Thanks in advance.