Skip to content

Commit b3225ef

Browse files
authored
Adds support for netbox v3.6 (#576)
1 parent 0981320 commit b3225ef

File tree

12 files changed

+92
-57
lines changed

12 files changed

+92
-57
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ body:
1818
attributes:
1919
label: NetBox version
2020
description: What version of NetBox are you currently running?
21-
placeholder: v3.5.8
21+
placeholder: v3.6.0
2222
validations:
2323
required: true
2424
- type: dropdown

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ body:
2121
attributes:
2222
label: NetBox version
2323
description: What version of NetBox are you currently running?
24-
placeholder: v3.5.8
24+
placeholder: v3.6.0
2525
validations:
2626
required: true
2727
- type: dropdown

.github/workflows/py3.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
python: ["3.8", "3.9", "3.10", "3.11"]
16-
netbox: ["3.3", "3.4", "3.5"]
16+
netbox: ["3.3", "3.4", "3.5", "3.6"]
1717

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

pynetbox/core/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def config(self):
7575
{'tables': {'DeviceTable': {'columns': ['name',
7676
'status',
7777
'tenant',
78-
'device_role',
78+
'role',
7979
'site',
8080
'primary_ip',
8181
'tags']}}}

pynetbox/core/endpoint.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def create(self, *args, **kwargs):
323323
324324
>>> device = netbox.dcim.devices.create(
325325
... name='test',
326-
... device_role=1,
326+
... role=1,
327327
... )
328328
>>>
329329
@@ -344,14 +344,14 @@ def create(self, *args, **kwargs):
344344
>>> nb.dcim.devices.create([
345345
... {
346346
... "name": "test1-core3",
347-
... "device_role": 3,
347+
... "role": 3,
348348
... "site": 1,
349349
... "device_type": 1,
350350
... "status": 1
351351
... },
352352
... {
353353
... "name": "test1-core4",
354-
... "device_role": 3,
354+
... "role": 3,
355355
... "site": 1,
356356
... "device_type": 1,
357357
... "status": 1

pynetbox/core/response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class Record:
226226
'config_context': {},
227227
'created': '2018-04-01',
228228
'custom_fields': {},
229-
'device_role': {'id': 1,
229+
'role': {'id': 1,
230230
'name': 'Test Switch',
231231
'slug': 'test-switch',
232232
'url': 'http://localhost:8000/api/dcim/device-roles/1/'},

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from packaging import version
55

66

7-
DEFAULT_NETBOX_VERSIONS = "3.3"
7+
DEFAULT_NETBOX_VERSIONS = "3.6"
88

99

1010
def pytest_addoption(parser):
@@ -39,7 +39,7 @@ def pytest_addoption(parser):
3939
action="store",
4040
help=(
4141
"Overrides the URL to run tests to. This allows for testing to the same"
42-
" containers for seperate runs."
42+
" containers for separate runs."
4343
),
4444
)
4545

tests/fixtures/dcim/device.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"model": "MX960",
1515
"slug": "mx960"
1616
},
17-
"device_role": {
17+
"role": {
1818
"id": 1,
1919
"url": "http://localhost:8000/api/dcim/device-roles/1/",
2020
"name": "Router",

tests/fixtures/dcim/device_bulk_create.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"id": 1,
44
"name": "test1-core3",
55
"device_type": 1,
6-
"device_role": 3,
6+
"role": 3,
77
"tenant": null,
88
"platform": null,
99
"serial": "",
@@ -22,7 +22,7 @@
2222
"id": 2,
2323
"name": "test1-core4",
2424
"device_type": 1,
25-
"device_role": 3,
25+
"role": 3,
2626
"tenant": null,
2727
"platform": null,
2828
"serial": "",

tests/fixtures/dcim/devices.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"model": "EX9214",
2020
"slug": "ex9214"
2121
},
22-
"device_role": {
22+
"role": {
2323
"id": 3,
2424
"url": "http://localhost:8000/api/dcim/device-roles/3/",
2525
"name": "Core Switch",
@@ -88,7 +88,7 @@
8888
"model": "EX9214",
8989
"slug": "ex9214"
9090
},
91-
"device_role": {
91+
"role": {
9292
"id": 3,
9393
"url": "http://localhost:8000/api/dcim/device-roles/3/",
9494
"name": "Core Switch",
@@ -157,7 +157,7 @@
157157
"model": "MX960",
158158
"slug": "mx960"
159159
},
160-
"device_role": {
160+
"role": {
161161
"id": 1,
162162
"url": "http://localhost:8000/api/dcim/device-roles/1/",
163163
"name": "Router",
@@ -226,7 +226,7 @@
226226
"model": "MX960",
227227
"slug": "mx960"
228228
},
229-
"device_role": {
229+
"role": {
230230
"id": 1,
231231
"url": "http://localhost:8000/api/dcim/device-roles/1/",
232232
"name": "Router",
@@ -295,7 +295,7 @@
295295
"model": "QFX5100-48S",
296296
"slug": "qfx5100-48s"
297297
},
298-
"device_role": {
298+
"role": {
299299
"id": 4,
300300
"url": "http://localhost:8000/api/dcim/device-roles/4/",
301301
"name": "Leaf Switch",
@@ -354,7 +354,7 @@
354354
"model": "QFX5100-48S",
355355
"slug": "qfx5100-48s"
356356
},
357-
"device_role": {
357+
"role": {
358358
"id": 4,
359359
"url": "http://localhost:8000/api/dcim/device-roles/4/",
360360
"name": "Leaf Switch",
@@ -413,7 +413,7 @@
413413
"model": "CM4148",
414414
"slug": "cm4148"
415415
},
416-
"device_role": {
416+
"role": {
417417
"id": 5,
418418
"url": "http://localhost:8000/api/dcim/device-roles/5/",
419419
"name": "OOB Switch",
@@ -472,7 +472,7 @@
472472
"model": "CWG-24VYM415C9",
473473
"slug": "cwg-24vym415c9"
474474
},
475-
"device_role": {
475+
"role": {
476476
"id": 6,
477477
"url": "http://localhost:8000/api/dcim/device-roles/6/",
478478
"name": "PDU",
@@ -523,7 +523,7 @@
523523
"model": "CWG-24VYM415C9",
524524
"slug": "cwg-24vym415c9"
525525
},
526-
"device_role": {
526+
"role": {
527527
"id": 6,
528528
"url": "http://localhost:8000/api/dcim/device-roles/6/",
529529
"name": "PDU",
@@ -574,7 +574,7 @@
574574
"model": "QFX5100-24Q",
575575
"slug": "qfx5100-24q"
576576
},
577-
"device_role": {
577+
"role": {
578578
"id": 2,
579579
"url": "http://localhost:8000/api/dcim/device-roles/2/",
580580
"name": "Spine Switch",
@@ -633,7 +633,7 @@
633633
"model": "QFX5100-24Q",
634634
"slug": "qfx5100-24q"
635635
},
636-
"device_role": {
636+
"role": {
637637
"id": 2,
638638
"url": "http://localhost:8000/api/dcim/device-roles/2/",
639639
"name": "Spine Switch",

0 commit comments

Comments
 (0)