Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inventory.py to work with nautobot 1.3.1 #135

Merged
merged 4 commits into from Apr 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/inventory/inventory.py
Expand Up @@ -1071,8 +1071,8 @@ def fetch_api_docs(self):
openapi = self._fetch_information(self.api_endpoint + "/api/docs/?format=openapi")

self.api_version = openapi["info"]["version"]
self.allowed_device_query_parameters = [p["name"] for p in openapi["paths"]["/dcim/devices/"]["get"]["parameters"]]
self.allowed_vm_query_parameters = [p["name"] for p in openapi["paths"]["/virtualization/virtual-machines/"]["get"]["parameters"]]
self.allowed_device_query_parameters = [p["name"] for p in openapi["paths"]["/api/dcim/devices/"]["get"]["parameters"]]
FragmentedPacket marked this conversation as resolved.
Show resolved Hide resolved
self.allowed_vm_query_parameters = [p["name"] for p in openapi["paths"]["/api/virtualization/virtual-machines/"]["get"]["parameters"]]

def validate_query_parameter(self, parameter, allowed_query_parameters):
if not (isinstance(parameter, dict) and len(parameter) == 1):
Expand Down