Skip to content

Commit

Permalink
Fix connection for the status api call. No results in the output.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas committed Jun 27, 2023
1 parent 9df2e5e commit 845921c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion netbox/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
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 = [
Expand Down

0 comments on commit 845921c

Please sign in to comment.