Skip to content

Commit db81041

Browse files
Andrewadp-ncc
authored andcommitted
Fix #1469 - the old api code path didnt get the variable defined that is being used to locate the api endpoints
1 parent 7030c5a commit db81041

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/inventory/nb_inventory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,10 +1648,10 @@ def fetch_api_docs(self):
16481648
pass
16491649

16501650
self.api_version = version.parse(netbox_api_version)
1651+
parsed_endpoint_url = urlparse(self.api_endpoint)
1652+
base_path = parsed_endpoint_url.path
16511653

16521654
if self.api_version >= version.parse("3.5.0"):
1653-
parsed_endpoint_url = urlparse(self.api_endpoint)
1654-
base_path = parsed_endpoint_url.path
16551655
self.allowed_device_query_parameters = [
16561656
p["name"]
16571657
for p in openapi["paths"][base_path + "/api/dcim/devices/"]["get"][

0 commit comments

Comments
 (0)