Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/1469-fix-old-apis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Fix broken code path when using old api path on old netbox systems
4 changes: 2 additions & 2 deletions plugins/inventory/nb_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1648,10 +1648,10 @@ def fetch_api_docs(self):
pass

self.api_version = version.parse(netbox_api_version)
parsed_endpoint_url = urlparse(self.api_endpoint)
base_path = parsed_endpoint_url.path

if self.api_version >= version.parse("3.5.0"):
parsed_endpoint_url = urlparse(self.api_endpoint)
base_path = parsed_endpoint_url.path
self.allowed_device_query_parameters = [
p["name"]
for p in openapi["paths"][base_path + "/api/dcim/devices/"]["get"][
Expand Down
Loading