From 845921cae64eafe23bad57021fc2833b24be32f9 Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 27 Jun 2023 13:57:01 +0200 Subject: [PATCH] Fix connection for the status api call. No results in the output. --- netbox/connection.py | 5 ++++- setup.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/netbox/connection.py b/netbox/connection.py index 4069210..2a53535 100644 --- a/netbox/connection.py +++ b/netbox/connection.py @@ -71,7 +71,7 @@ def __request(self, method, params=None, key=None, body=None, url=None): if response.status_code == 204: return response.content - if(method == "GET" and ("&export=" in url or "?export=" in url)): + if method == "GET" and ("&export=" in url or "?export=" in url): # return raw result if export template is specified return {"results": response.text} @@ -97,6 +97,9 @@ def get(self, param, key=None, limit=0, **kwargs): resp_data = self.__request('GET', params=param, key=key, url=url) + if 'status' in param: + return resp_data + return resp_data['results'] def put(self, params): diff --git a/setup.py b/setup.py index d7b0aa6..4919dbe 100644 --- a/setup.py +++ b/setup.py @@ -14,14 +14,14 @@ def readme(): setup(name='python-netbox', - version='0.0.23', + version='0.0.24', description='Python NetBox Client', long_description=readme(), python_requires='>=3', author='Thomas van der Jagt', author_email='thomas@tjrb.nl', url='https://github.com/jagter/python-netbox', - download_url='https://github.com/jagter/python-netbox/releases/tag/0.0.23.tar.gz', + download_url='https://github.com/jagter/python-netbox/releases/tag/0.0.24.tar.gz', packages=find_packages(), install_requires=['ipaddress', 'requests'], classifiers = [