-
Notifications
You must be signed in to change notification settings - Fork 190
create_token creates v2 tokens but expects v1 tokens #756
Copy link
Copy link
Open
Labels
app: pynetboxseverity: mediumResults in substantial degraded or broken functionality for specfic workflowsResults in substantial degraded or broken functionality for specfic workflowsstatus: needs ownerThis issue is tentatively accepted pending a volunteer committed to its implementationThis issue is tentatively accepted pending a volunteer committed to its implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
pynetbox version
v7.6.1
NetBox version
v4.5.5
Python version
3.10
Steps to Reproduce
import pynetbox
nb = pynetbox.api('https://netbox.example.com')
token = nb.create_token('username', 'password')
https://github.com/netbox-community/pynetbox/blob/v7.6.1/pynetbox/core/api.py#L262
Expected Behavior
Token is created and added to session
e.g.
<pynetbox.core.api.Api object at 0x78d82ebd3b50>
CRu8qzbg9RRc
Observed Behavior
File "../pynetbox/core/response.py", line 347, in __str__
getattr(self, "name", None)
File "../pynetbox/core/response.py", line 323, in __getattr__
if self.full_details():
File "../pynetbox/core/response.py", line 527, in full_details
self._parse_values(next(req.get()))
File "../pynetbox/core/query.py", line 446, in get
req = self._make_call(add_params=add_params)
File "../pynetbox/core/query.py", line 412, in _make_call
raise RequestError(req)
pynetbox.core.query.RequestError: The request failed with code 403 Forbidden: {'detail': 'Invalid v1 token'}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
app: pynetboxseverity: mediumResults in substantial degraded or broken functionality for specfic workflowsResults in substantial degraded or broken functionality for specfic workflowsstatus: needs ownerThis issue is tentatively accepted pending a volunteer committed to its implementationThis issue is tentatively accepted pending a volunteer committed to its implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application