Skip to content

Commit c84ca29

Browse files
authored
Develop (#635)
1 parent ef2271d commit c84ca29

31 files changed

+89
-100
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,24 @@ body:
1111
attributes:
1212
label: pynetbox version
1313
description: What version of pynetbox are you currently running?
14-
placeholder: v7.1.0
14+
placeholder: v7.4.0
1515
validations:
1616
required: true
1717
- type: input
1818
attributes:
1919
label: NetBox version
2020
description: What version of NetBox are you currently running?
21-
placeholder: v3.6.0
21+
placeholder: v4.0.8
2222
validations:
2323
required: true
2424
- type: dropdown
2525
attributes:
2626
label: Python version
2727
description: What version of Python are you currently running?
2828
options:
29-
- "3.8"
30-
- "3.9"
3129
- "3.10"
3230
- "3.11"
31+
- "3.12"
3332
validations:
3433
required: true
3534
- type: textarea

.github/workflows/py3.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python: ["3.8", "3.9", "3.10", "3.11"]
16-
netbox: ["3.4", "3.5", "3.6", "3.7"]
15+
python: ["3.10", "3.11", "3.12"]
16+
netbox: ["3.6", "3.7", "4.0"]
1717

1818
steps:
1919
- uses: actions/checkout@v4

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ Python API client library for [NetBox](https://github.com/netbox-community/netbo
33

44
> **Note:** Version 6.7 and later of the library only supports NetBox 3.3 and above.
55
6+
## Compatibility
7+
8+
Each pyNetBox Version listed below has been tested with its corresponding NetBox Version.
9+
10+
| NetBox Version | Plugin Version |
11+
|:--------------:|:--------------:|
12+
| 4.0.6 | 7.4.0 |
13+
| 4.0.0 | 7.3.4 |
14+
| 3.7 | 7.3.0 |
15+
| 3.6 | 7.2.0 |
16+
| 3.5 | 7.1.0 |
17+
| 3.3 | 7.0.0 |
18+
619
## Installation
720

821
To install run `pip install pynetbox`.

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
# -- Project information -----------------------------------------------------
99
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1010

11-
project = 'pynetbox'
12-
copyright = '2023, NetBox'
13-
author = 'Abhimanyu Saharan'
14-
release = 'Apache2'
11+
project = "pynetbox"
12+
copyright = "2023, NetBox"
13+
author = "Abhimanyu Saharan"
14+
release = "Apache2"
1515

1616
# -- General configuration ---------------------------------------------------
1717
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

pynetbox/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from importlib.metadata import version
2-
3-
from pynetbox.core.query import RequestError, AllocationError, ContentError
41
from pynetbox.core.api import Api as api
2+
from pynetbox.core.query import AllocationError, ContentError, RequestError
53

6-
__version__ = version(__name__)
4+
__version__ = "7.4.0"

pynetbox/core/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
import requests
1818

19-
from pynetbox.core.query import Request
2019
from pynetbox.core.app import App, PluginsApp
20+
from pynetbox.core.query import Request
2121
from pynetbox.core.response import Record
2222

2323

pynetbox/core/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
from pynetbox.core.endpoint import Endpoint
1818
from pynetbox.core.query import Request
1919
from pynetbox.models import (
20-
dcim,
21-
ipam,
22-
virtualization,
2320
circuits,
21+
dcim,
2422
extras,
23+
ipam,
2524
users,
25+
virtualization,
2626
wireless,
2727
)
2828

pynetbox/core/endpoint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,9 @@ def filter(self, *args, **kwargs):
286286
offset = kwargs.pop("offset") if "offset" in kwargs else None
287287
if limit == 0 and offset is not None:
288288
raise ValueError("offset requires a positive limit value")
289+
filters = {x: y if y is not None else "null" for x, y in kwargs.items()}
289290
req = Request(
290-
filters=kwargs,
291+
filters=filters,
291292
base=self.url,
292293
token=self.token,
293294
http_session=self.api.http_session,

pynetbox/core/query.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import concurrent.futures as cf
1818
import json
19+
1920
from packaging import version
2021

2122

pynetbox/core/response.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616

1717
import copy
1818
from collections import OrderedDict
19+
from urllib.parse import urlsplit
1920

2021
import pynetbox.core.app
21-
from urllib.parse import urlsplit
2222
from pynetbox.core.query import Request
2323
from pynetbox.core.util import Hashabledict
2424

25-
2625
# List of fields that are lists but should be treated as sets.
2726
LIST_AS_SET = ("tags", "tagged_vlans")
2827

@@ -68,7 +67,7 @@ def flatten_custom(custom_dict):
6867
current_val = val.get("id", val)
6968

7069
if isinstance(val, list):
71-
current_val = [v.get("id") if isinstance(v, dict) else v for v in val]
70+
current_val = [v.get("id", v) if isinstance(v, dict) else v for v in val]
7271

7372
ret[k] = current_val
7473
return ret

0 commit comments

Comments
 (0)