TypeError: list indices must be integers or slices, not str #183

Closed
opened 2021-03-10 21:05:10 +01:00 by izeen · 1 comment
izeen commented 2021-03-10 21:05:10 +01:00 (Migrated from github.com)

Hello!

Trying this out and getting errors when updating inventory, see below:

DEBUG:urllib3.connectionpool:https://netbox.xxxx:443 "GET /api/dcim/devices/?serial=C07JFKYXXX HTTP/1.1" 200 1085
Traceback (most recent call last):
File "/usr/local/bin/netbox_agent", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/netbox_agent/cli.py", line 44, in main
return run(config)
File "/usr/local/lib/python3.8/dist-packages/netbox_agent/cli.py", line 39, in run
server.netbox_create_or_update(config)
File "/usr/local/lib/python3.8/dist-packages/netbox_agent/server.py", line 295, in netbox_create_or_update
self.inventory = Inventory(server=self)
File "/usr/local/lib/python3.8/dist-packages/netbox_agent/inventory.py", line 56, in init
self.lshw = LSHW()
File "/usr/local/lib/python3.8/dist-packages/netbox_agent/lshw.py", line 25, in init
self.vendor = self.hw_info["vendor"]
TypeError: list indices must be integers or slices, not str

For reference this is a macmini running ubuntu 20.04,

There also seems to be a type error in the exampel yaml, if you run it through a validator you get:

(): could not find expected ':' while scanning a simple key at line 28 column 1 removing line 28 solves the issue.

Hello! Trying this out and getting errors when updating inventory, see below: DEBUG:urllib3.connectionpool:https://netbox.xxxx:443 "GET /api/dcim/devices/?serial=C07JFKYXXX HTTP/1.1" 200 1085 Traceback (most recent call last): File "/usr/local/bin/netbox_agent", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.8/dist-packages/netbox_agent/cli.py", line 44, in main return run(config) File "/usr/local/lib/python3.8/dist-packages/netbox_agent/cli.py", line 39, in run server.netbox_create_or_update(config) File "/usr/local/lib/python3.8/dist-packages/netbox_agent/server.py", line 295, in netbox_create_or_update self.inventory = Inventory(server=self) File "/usr/local/lib/python3.8/dist-packages/netbox_agent/inventory.py", line 56, in __init__ self.lshw = LSHW() File "/usr/local/lib/python3.8/dist-packages/netbox_agent/lshw.py", line 25, in __init__ self.vendor = self.hw_info["vendor"] TypeError: list indices must be integers or slices, not str For reference this is a macmini running ubuntu 20.04, There also seems to be a type error in the exampel yaml, if you run it through a validator you get: (<unknown>): could not find expected ':' while scanning a simple key at line 28 column 1 removing line 28 solves the issue.
ribetm commented 2024-10-12 22:01:13 +02:00 (Migrated from github.com)

Fixed by #202

Fixed by #202
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DGNum/netbox-agent#183
No description provided.