Device-Type-Library-Import
Device-Type-Library-Import copied to clipboard
Getting Credentials not provided
I've tried different tokens and users, but get the same result. Followed the steps provided with no change.
Traceback (most recent call last):
File "/home/bnicoson/Device-Type-Library-Import/./nb-dt-import.py", line 54, in <module>
main()
File "/home/bnicoson/Device-Type-Library-Import/./nb-dt-import.py", line 17, in main
netbox = NetBox(settings)
File "/home/bnicoson/Device-Type-Library-Import/netbox_api.py", line 28, in __init__
self.verify_compatibility()
File "/home/bnicoson/Device-Type-Library-Import/netbox_api.py", line 50, in verify_compatibility
version_split = [int(x) for x in self.netbox.version.split('.')]
File "/home/bnicoson/Device-Type-Library-Import/venv/lib/python3.10/site-packages/pynetbox/core/api.py", line 109, in version
).get_version()
File "/home/bnicoson/Device-Type-Library-Import/venv/lib/python3.10/site-packages/pynetbox/core/query.py", line 187, in get_version
raise RequestError(req)
pynetbox.core.query.RequestError: The request failed with code 403 Forbidden: {'detail': 'Authentication credentials were not provided.'}
Same issue. NetBox v4.1.11
Also here, 4.2.3
same issue with 4.2.3
Edit the requirements.txt with version 7.3.4 for pynetbox
Had same Issue. I got it solved in netbox_api.py, with setting the AUTH_HEADER manualy
def connect_api(self):
try:
self.netbox = pynetbox.api(self.url, token=self.token)
# Manuel set Auth_header!
self.netbox.http_session.headers.update({"Authorization": f"Token {self.token}"})
if self.ignore_ssl:
self.handle.verbose_log("IGNORE_SSL_ERRORS is True, disabling SSL verification.")
requests.packages.urllib3.disable_warnings()
self.netbox.http_session.verify = False
except Exception as e:
self.handle.exception("Exception", 'NetBox API Error', e)
Edit the requirements.txt with version 7.3.4 for pynetbox
this worked for me