You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you first create the nautobot.api class it runs the self._validate_version method which tries to connect to the Nautobot instance immediately. This can cause issues if the end user needs to modify the http session settings.
One alternative would be to accept the http session parameters as kwargs to the Api class, but that can be a cat and mouse game of keeping up with all options - and is definitely not scalable - so I'm not a fan.
Another alternative would be to allow for users to bypass this validation on initialization and expose it as a public method to let them validate themselves. This is all well and good, but I'd still like it to happen automatically.
My initial thought would be to add a boolean flag like self._version_validated=False, and any time we are about to make a call to Nautobot we can check if it's false and run self._validate_version first.
I'm open to other ideas if anyone else would like to weigh in.
The text was updated successfully, but these errors were encountered:
When you first create the
nautobot.api
class it runs theself._validate_version
method which tries to connect to the Nautobot instance immediately. This can cause issues if the end user needs to modify the http session settings.One alternative would be to accept the http session parameters as kwargs to the Api class, but that can be a cat and mouse game of keeping up with all options - and is definitely not scalable - so I'm not a fan.
Another alternative would be to allow for users to bypass this validation on initialization and expose it as a public method to let them validate themselves. This is all well and good, but I'd still like it to happen automatically.
My initial thought would be to add a boolean flag like
self._version_validated=False
, and any time we are about to make a call to Nautobot we can check if it's false and runself._validate_version
first.I'm open to other ideas if anyone else would like to weigh in.
The text was updated successfully, but these errors were encountered: