Skip to content

Commit 99ab054

Browse files
Merge pull request #13705 from netbox-community/develop
Release v3.6.1
2 parents dfcfbe2 + 90ab4b3 commit 99ab054

File tree

35 files changed

+429
-180
lines changed

35 files changed

+429
-180
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body:
1414
attributes:
1515
label: NetBox version
1616
description: What version of NetBox are you currently running?
17-
placeholder: v3.6.0
17+
placeholder: v3.6.1
1818
validations:
1919
required: true
2020
- type: dropdown

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body:
1414
attributes:
1515
label: NetBox version
1616
description: What version of NetBox are you currently running?
17-
placeholder: v3.6.0
17+
placeholder: v3.6.1
1818
validations:
1919
required: true
2020
- type: dropdown

docs/models/dcim/platform.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,3 @@ If designated, this platform will be available for use only to devices assigned
2323
### Configuration Template
2424

2525
The default [configuration template](../extras/configtemplate.md) for devices assigned to this platform.
26-
27-
### NAPALM Driver
28-
29-
!!! warning "Deprecated Field"
30-
NAPALM integration was removed from NetBox core in v3.5 and is now available as a [plugin](https://github.com/netbox-community/netbox-napalm). This field will be removed in NetBox v3.6.
31-
32-
The [NAPALM driver](https://napalm.readthedocs.io/en/latest/support/index.html) associated with this platform.
33-
34-
### NAPALM Arguments
35-
36-
!!! warning "Deprecated Field"
37-
NAPALM integration was removed from NetBox core in v3.5 and is now available as a [plugin](https://github.com/netbox-community/netbox-napalm). This field will be removed in NetBox v3.6.
38-
39-
Any additional arguments to send when invoking the NAPALM driver assigned to this platform.

docs/plugins/development/navigation.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,15 @@ item1 = PluginMenuItem(
6464

6565
A `PluginMenuItem` has the following attributes:
6666

67-
| Attribute | Required | Description |
68-
|---------------|----------|------------------------------------------------------|
69-
| `link` | Yes | Name of the URL path to which this menu item links |
70-
| `link_text` | Yes | The text presented to the user |
71-
| `permissions` | - | A list of permissions required to display this link |
72-
| `buttons` | - | An iterable of PluginMenuButton instances to include |
67+
| Attribute | Required | Description |
68+
|---------------|----------|----------------------------------------------------------------------------------------------------------|
69+
| `link` | Yes | Name of the URL path to which this menu item links |
70+
| `link_text` | Yes | The text presented to the user |
71+
| `permissions` | - | A list of permissions required to display this link |
72+
| `staff_only` | - | Display only for users who have `is_staff` set to true (any specified permissions will also be required) |
73+
| `buttons` | - | An iterable of PluginMenuButton instances to include |
74+
75+
!!! info "The `staff_only` attribute was introduced in NetBox v3.6.1."
7376

7477
## Menu Buttons
7578

docs/release-notes/version-3.6.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,38 @@
11
# NetBox v3.6
22

3+
## v3.6.1 (2023-09-06)
4+
5+
### Enhancements
6+
7+
* [#12870](https://github.com/netbox-community/netbox/issues/12870) - Support setting token expiration time using the provisioning API endpoint
8+
* [#13444](https://github.com/netbox-community/netbox/issues/13444) - Add bulk rename functionality to the global device component lists
9+
* [#13638](https://github.com/netbox-community/netbox/issues/13638) - Add optional `staff_only` attribute to MenuItem
10+
11+
### Bug Fixes
12+
13+
* [#12553](https://github.com/netbox-community/netbox/issues/12552) - Ensure `family` attribute is always returned when creating aggregates and prefixes via REST API
14+
* [#13619](https://github.com/netbox-community/netbox/issues/13619) - Fix exception when viewing IP address assigned to a virtual machine
15+
* [#13596](https://github.com/netbox-community/netbox/issues/13596) - Always display "render config" tab for devices and virtual machines
16+
* [#13620](https://github.com/netbox-community/netbox/issues/13620) - Show admin menu items only for staff users
17+
* [#13622](https://github.com/netbox-community/netbox/issues/13622) - Fix exception when viewing current config and no revisions have been created
18+
* [#13626](https://github.com/netbox-community/netbox/issues/13626) - Correct filtering of recent activity list under user view
19+
* [#13628](https://github.com/netbox-community/netbox/issues/13628) - Remove stale references to obsolete NAPALM integration
20+
* [#13630](https://github.com/netbox-community/netbox/issues/13630) - Fix display of active status under user view
21+
* [#13632](https://github.com/netbox-community/netbox/issues/13632) - Avoid raising exception when checking if FHRP group IP address is primary
22+
* [#13642](https://github.com/netbox-community/netbox/issues/13642) - Suppress warning about unreflected model changes when applying migrations
23+
* [#13657](https://github.com/netbox-community/netbox/issues/13657) - Fix decoding of data file content
24+
* [#13674](https://github.com/netbox-community/netbox/issues/13674) - Fix retrieving individual report via REST API
25+
* [#13682](https://github.com/netbox-community/netbox/issues/13682) - Fix error message returned when validation of custom field default value fails
26+
* [#13684](https://github.com/netbox-community/netbox/issues/13684) - Enable modying the configuration when maintenance mode is enabled
27+
28+
---
29+
330
## v3.6.0 (2023-08-30)
431

532
### Breaking Changes
633

734
* PostgreSQL 11 is no longer supported (dropped in Django 4.2). NetBox v3.6 requires PostgreSQL 12 or later.
35+
* The `boto3` and `dulwich` packages are no longer installed automatically. If needed for S3/git remote data backend support, add them to `local_requirements.txt` to ensure their installation.
836
* The `device_role` field on the Device model has been renamed to `role`. The `device_role` field has been temporarily retained on the REST API serializer for devices for backward compatibility, but is read-only.
937
* The `choices` array field has been removed from the CustomField model. Any defined choices are automatically migrated to CustomFieldChoiceSets, accessible via the new `choice_set` field on the CustomField model.
1038
* The `napalm_driver` and `napalm_args` fields (which were deprecated in v3.5) have been removed from the Platform model.
@@ -85,8 +113,9 @@ Tags may now be restricted to use with designated object types. Tags that have n
85113
* [#11766](https://github.com/netbox-community/netbox/issues/11766) - Remove obsolete custom `ChoiceField` and `MultipleChoiceField` classes
86114
* [#12180](https://github.com/netbox-community/netbox/issues/12180) - All API endpoints for available objects (e.g. IP addresses) now inherit from a common parent view
87115
* [#12237](https://github.com/netbox-community/netbox/issues/12237) - Upgrade Django to v4.2
88-
* [#12794](https://github.com/netbox-community/netbox/issues/12794) - Avoid direct imports of Django's stock user model
89116
* [#12320](https://github.com/netbox-community/netbox/issues/12320) - Remove obsolete fields `napalm_driver` and `napalm_args` from Platform
117+
* [#12794](https://github.com/netbox-community/netbox/issues/12794) - Avoid direct imports of Django's stock user model
118+
* [#12906](https://github.com/netbox-community/netbox/issues/12906) - The `boto3` (AWS) and `dulwich` (git) packages for remote data sources are now optional requirements
90119
* [#12964](https://github.com/netbox-community/netbox/issues/12964) - Drop support for PostgreSQL 11
91120
* [#13309](https://github.com/netbox-community/netbox/issues/13309) - User account-specific resources have been moved to a new `account` app for better organization
92121

netbox/core/apps.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
from django.apps import AppConfig
2+
from django.db import models
3+
from django.db.migrations.operations import AlterModelOptions
4+
5+
from utilities.migration import custom_deconstruct
6+
7+
# Ignore verbose_name & verbose_name_plural Meta options when calculating model migrations
8+
AlterModelOptions.ALTER_OPTION_KEYS.remove('verbose_name')
9+
AlterModelOptions.ALTER_OPTION_KEYS.remove('verbose_name_plural')
10+
11+
# Use our custom destructor to ignore certain attributes when calculating field migrations
12+
models.Field.deconstruct = custom_deconstruct
213

314

415
class CoreConfig(AppConfig):

netbox/core/management/commands/makemigrations.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1-
# noinspection PyUnresolvedReferences
21
from django.conf import settings
32
from django.core.management.base import CommandError
43
from django.core.management.commands.makemigrations import Command as _Command
5-
from django.db import models
6-
from django.db.migrations.operations import AlterModelOptions
7-
8-
from utilities.migration import custom_deconstruct
9-
10-
# Monkey patch AlterModelOptions to ignore verbose name attributes
11-
AlterModelOptions.ALTER_OPTION_KEYS.remove('verbose_name')
12-
AlterModelOptions.ALTER_OPTION_KEYS.remove('verbose_name_plural')
13-
14-
# Set our custom deconstructor for fields
15-
models.Field.deconstruct = custom_deconstruct
164

175

186
class Command(_Command):

netbox/core/management/commands/migrate.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

netbox/core/models/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def data_as_string(self):
316316
if not self.data:
317317
return None
318318
try:
319-
return bytes(self.data, 'utf-8')
319+
return self.data.decode('utf-8')
320320
except UnicodeDecodeError:
321321
return None
322322

netbox/core/views.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from django.shortcuts import get_object_or_404, redirect
33

44
from extras.models import ConfigRevision
5+
from netbox.config import get_config
56
from netbox.views import generic
67
from netbox.views.generic.base import BaseObjectView
78
from utilities.utils import count_related
@@ -152,4 +153,9 @@ class ConfigView(generic.ObjectView):
152153
queryset = ConfigRevision.objects.all()
153154

154155
def get_object(self, **kwargs):
155-
return self.queryset.first()
156+
if config := self.queryset.first():
157+
return config
158+
# Instantiate a dummy default config if none has been created yet
159+
return ConfigRevision(
160+
data=get_config().defaults
161+
)

netbox/dcim/api/serializers.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -787,10 +787,6 @@ class Meta:
787787
]
788788

789789

790-
class DeviceNAPALMSerializer(serializers.Serializer):
791-
method = serializers.JSONField()
792-
793-
794790
#
795791
# Device components
796792
#

netbox/dcim/views.py

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,6 @@ class DeviceRenderConfigView(generic.ObjectView):
20332033
template_name = 'dcim/device/render_config.html'
20342034
tab = ViewTab(
20352035
label=_('Render Config'),
2036-
permission='extras.view_configtemplate',
20372036
weight=2100
20382037
)
20392038

@@ -2185,6 +2184,15 @@ class ConsolePortListView(generic.ObjectListView):
21852184
filterset = filtersets.ConsolePortFilterSet
21862185
filterset_form = forms.ConsolePortFilterForm
21872186
table = tables.ConsolePortTable
2187+
template_name = 'dcim/component_list.html'
2188+
actions = ('add', 'import', 'export', 'bulk_edit', 'bulk_delete', 'bulk_rename')
2189+
action_perms = defaultdict(set, **{
2190+
'add': {'add'},
2191+
'import': {'add'},
2192+
'bulk_edit': {'change'},
2193+
'bulk_delete': {'delete'},
2194+
'bulk_rename': {'change'},
2195+
})
21882196

21892197

21902198
@register_model_view(ConsolePort)
@@ -2248,6 +2256,15 @@ class ConsoleServerPortListView(generic.ObjectListView):
22482256
filterset = filtersets.ConsoleServerPortFilterSet
22492257
filterset_form = forms.ConsoleServerPortFilterForm
22502258
table = tables.ConsoleServerPortTable
2259+
template_name = 'dcim/component_list.html'
2260+
actions = ('add', 'import', 'export', 'bulk_edit', 'bulk_delete', 'bulk_rename')
2261+
action_perms = defaultdict(set, **{
2262+
'add': {'add'},
2263+
'import': {'add'},
2264+
'bulk_edit': {'change'},
2265+
'bulk_delete': {'delete'},
2266+
'bulk_rename': {'change'},
2267+
})
22512268

22522269

22532270
@register_model_view(ConsoleServerPort)
@@ -2311,6 +2328,15 @@ class PowerPortListView(generic.ObjectListView):
23112328
filterset = filtersets.PowerPortFilterSet
23122329
filterset_form = forms.PowerPortFilterForm
23132330
table = tables.PowerPortTable
2331+
template_name = 'dcim/component_list.html'
2332+
actions = ('add', 'import', 'export', 'bulk_edit', 'bulk_delete', 'bulk_rename')
2333+
action_perms = defaultdict(set, **{
2334+
'add': {'add'},
2335+
'import': {'add'},
2336+
'bulk_edit': {'change'},
2337+
'bulk_delete': {'delete'},
2338+
'bulk_rename': {'change'},
2339+
})
23142340

23152341

23162342
@register_model_view(PowerPort)
@@ -2374,6 +2400,15 @@ class PowerOutletListView(generic.ObjectListView):
23742400
filterset = filtersets.PowerOutletFilterSet
23752401
filterset_form = forms.PowerOutletFilterForm
23762402
table = tables.PowerOutletTable
2403+
template_name = 'dcim/component_list.html'
2404+
actions = ('add', 'import', 'export', 'bulk_edit', 'bulk_delete', 'bulk_rename')
2405+
action_perms = defaultdict(set, **{
2406+
'add': {'add'},
2407+
'import': {'add'},
2408+
'bulk_edit': {'change'},
2409+
'bulk_delete': {'delete'},
2410+
'bulk_rename': {'change'},
2411+
})
23772412

23782413

23792414
@register_model_view(PowerOutlet)
@@ -2437,6 +2472,15 @@ class InterfaceListView(generic.ObjectListView):
24372472
filterset = filtersets.InterfaceFilterSet
24382473
filterset_form = forms.InterfaceFilterForm
24392474
table = tables.InterfaceTable
2475+
template_name = 'dcim/component_list.html'
2476+
actions = ('add', 'import', 'export', 'bulk_edit', 'bulk_delete', 'bulk_rename')
2477+
action_perms = defaultdict(set, **{
2478+
'add': {'add'},
2479+
'import': {'add'},
2480+
'bulk_edit': {'change'},
2481+
'bulk_delete': {'delete'},
2482+
'bulk_rename': {'change'},
2483+
})
24402484

24412485

24422486
@register_model_view(Interface)
@@ -2548,6 +2592,15 @@ class FrontPortListView(generic.ObjectListView):
25482592
filterset = filtersets.FrontPortFilterSet
25492593
filterset_form = forms.FrontPortFilterForm
25502594
table = tables.FrontPortTable
2595+
template_name = 'dcim/component_list.html'
2596+
actions = ('add', 'import', 'export', 'bulk_edit', 'bulk_delete', 'bulk_rename')
2597+
action_perms = defaultdict(set, **{
2598+
'add': {'add'},
2599+
'import': {'add'},
2600+
'bulk_edit': {'change'},
2601+
'bulk_delete': {'delete'},
2602+
'bulk_rename': {'change'},
2603+
})
25512604

25522605

25532606
@register_model_view(FrontPort)
@@ -2611,6 +2664,15 @@ class RearPortListView(generic.ObjectListView):
26112664
filterset = filtersets.RearPortFilterSet
26122665
filterset_form = forms.RearPortFilterForm
26132666
table = tables.RearPortTable
2667+
template_name = 'dcim/component_list.html'
2668+
actions = ('add', 'import', 'export', 'bulk_edit', 'bulk_delete', 'bulk_rename')
2669+
action_perms = defaultdict(set, **{
2670+
'add': {'add'},
2671+
'import': {'add'},
2672+
'bulk_edit': {'change'},
2673+
'bulk_delete': {'delete'},
2674+
'bulk_rename': {'change'},
2675+
})
26142676

26152677

26162678
@register_model_view(RearPort)
@@ -2674,6 +2736,15 @@ class ModuleBayListView(generic.ObjectListView):
26742736
filterset = filtersets.ModuleBayFilterSet
26752737
filterset_form = forms.ModuleBayFilterForm
26762738
table = tables.ModuleBayTable
2739+
template_name = 'dcim/component_list.html'
2740+
actions = ('add', 'import', 'export', 'bulk_edit', 'bulk_delete', 'bulk_rename')
2741+
action_perms = defaultdict(set, **{
2742+
'add': {'add'},
2743+
'import': {'add'},
2744+
'bulk_edit': {'change'},
2745+
'bulk_delete': {'delete'},
2746+
'bulk_rename': {'change'},
2747+
})
26772748

26782749

26792750
@register_model_view(ModuleBay)
@@ -2729,6 +2800,15 @@ class DeviceBayListView(generic.ObjectListView):
27292800
filterset = filtersets.DeviceBayFilterSet
27302801
filterset_form = forms.DeviceBayFilterForm
27312802
table = tables.DeviceBayTable
2803+
template_name = 'dcim/component_list.html'
2804+
actions = ('add', 'import', 'export', 'bulk_edit', 'bulk_delete', 'bulk_rename')
2805+
action_perms = defaultdict(set, **{
2806+
'add': {'add'},
2807+
'import': {'add'},
2808+
'bulk_edit': {'change'},
2809+
'bulk_delete': {'delete'},
2810+
'bulk_rename': {'change'},
2811+
})
27322812

27332813

27342814
@register_model_view(DeviceBay)
@@ -2853,6 +2933,15 @@ class InventoryItemListView(generic.ObjectListView):
28532933
filterset = filtersets.InventoryItemFilterSet
28542934
filterset_form = forms.InventoryItemFilterForm
28552935
table = tables.InventoryItemTable
2936+
template_name = 'dcim/component_list.html'
2937+
actions = ('add', 'import', 'export', 'bulk_edit', 'bulk_delete', 'bulk_rename')
2938+
action_perms = defaultdict(set, **{
2939+
'add': {'add'},
2940+
'import': {'add'},
2941+
'bulk_edit': {'change'},
2942+
'bulk_delete': {'delete'},
2943+
'bulk_rename': {'change'},
2944+
})
28562945

28572946

28582947
@register_model_view(InventoryItem)

netbox/extras/api/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ class ReportSerializer(serializers.Serializer):
479479
module = serializers.CharField(max_length=255)
480480
name = serializers.CharField(max_length=255)
481481
description = serializers.CharField(max_length=255, required=False)
482-
test_methods = serializers.ListField(child=serializers.CharField(max_length=255))
482+
test_methods = serializers.ListField(child=serializers.CharField(max_length=255), read_only=True)
483483
result = NestedJobSerializer()
484484
display = serializers.SerializerMethodField(read_only=True)
485485

0 commit comments

Comments
 (0)