Skip to content

Commit f1d4011

Browse files
Merge pull request #14542 from netbox-community/develop
Release v3.6.7
2 parents 28080e9 + 4cdc30a commit f1d4011

File tree

41 files changed

+397
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+397
-86
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,25 @@ body:
1010
installation. If you're having trouble with installation or just looking for
1111
assistance with using NetBox, please visit our
1212
[discussion forum](https://github.com/netbox-community/netbox/discussions) instead.
13+
- type: dropdown
14+
attributes:
15+
label: Deployment Type
16+
description: How are you running NetBox?
17+
options:
18+
- Self-hosted
19+
- NetBox Cloud
20+
validations:
21+
required: true
1322
- type: input
1423
attributes:
15-
label: NetBox version
24+
label: NetBox Version
1625
description: What version of NetBox are you currently running?
17-
placeholder: v3.6.6
26+
placeholder: v3.6.7
1827
validations:
1928
required: true
2029
- type: dropdown
2130
attributes:
22-
label: Python version
31+
label: Python Version
2332
description: What version of Python are you currently running?
2433
options:
2534
- "3.8"

.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.6
17+
placeholder: v3.6.7
1818
validations:
1919
required: true
2020
- type: dropdown

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ NetBox users are welcome to participate in either role, on stage or in the crowd
3636

3737
## :bug: Reporting Bugs
3838

39+
:warning: Bug reports are used to call attention to some unintended or unexpected behavior in NetBox, such as when an error occurs or when the result of taking some action is inconsistent with the documentation. **Bug reports may not be used to suggest new functionality**; please see "feature requests" below if that is your goal.
40+
3941
* First, ensure that you're running the [latest stable version](https://github.com/netbox-community/netbox/releases) of NetBox. If you're running an older version, it's likely that the bug has already been fixed.
4042

4143
* Next, search our [issues list](https://github.com/netbox-community/netbox/issues?q=is%3Aissue) to see if the bug you've found has already been reported. If you come across a bug report that seems to match, please click "add a reaction" in the top right corner of the issue and add a thumbs up (:thumbsup:). This will help draw more attention to it. Any comments you can add to provide additional information or context would also be much appreciated.

docs/features/synchronized-data.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ To enable remote data synchronization, the NetBox administrator first designates
1010

1111
(Local disk paths are considered "remote" in this context as they exist outside NetBox's database. These paths could also be mapped to external network shares.)
1212

13-
1413
!!! info
1514
Data backends which connect to external sources typically require the installation of one or more supporting Python libraries. The Git backend requires the [`dulwich`](https://www.dulwich.io/) package, and the S3 backend requires the [`boto3`](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html) package. These must be installed within NetBox's environment to enable these backends.
1615

@@ -23,3 +22,6 @@ The following NetBox models can be associated with replicated data files:
2322
* Export templates
2423

2524
Once a data has been designated for a local instance, its data will be replaced with the content of the replicated file. When the replicated file is updated in the future (via synchronization jobs), the local instance will be flagged as having out-of-date data. A user can then synchronize these objects individually or in bulk to effect the update. This two-stage process ensures that automated synchronization tasks do not immediately affect production data.
25+
26+
!!! note "Permissions"
27+
A user must be assigned the `core.sync_datasource` permission in order to synchronize local files from a remote data source.

docs/integrations/synchronized-data.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Some NetBox models support automatic synchronization of certain attributes from remote [data sources](../models/core/datasource.md), such as a git repository hosted on GitHub or GitLab. Data from the authoritative remote source is synchronized locally in NetBox as [data files](../models/core/datafile.md).
44

5+
!!! note "Permissions"
6+
A user must be assigned the `core.sync_datasource` permission in order to synchronize local files from a remote data source. This is accomplished by creating a permission for the "Core > Data Source" object type with the `sync` action, and assigning it to the desired user and/or group.
7+
58
The following features support the use of synchronized data:
69

710
* [Configuration templates](../features/configuration-rendering.md)

docs/release-notes/version-3.6.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# NetBox v3.6
22

3+
## v3.6.7 (2023-12-15)
4+
5+
### Enhancements
6+
7+
* [#12751](https://github.com/netbox-community/netbox/issues/12751) - Designate fields to expand by default for object selector widget
8+
* [#14148](https://github.com/netbox-community/netbox/issues/14148) - Add tags column to L2VPN terminations column
9+
* [#14390](https://github.com/netbox-community/netbox/issues/14390) - Add `classes` parameter to `copy_content` template tag
10+
* [#14467](https://github.com/netbox-community/netbox/issues/14467) - Change custom field choice delimiter from comma to colon
11+
12+
### Bug Fixes
13+
14+
* [#13983](https://github.com/netbox-community/netbox/issues/13983) - Fix bulk import support for custom field choices
15+
* [#14081](https://github.com/netbox-community/netbox/issues/14081) - Ensure accuracy of parent object counters when deleting related objects
16+
* [#14249](https://github.com/netbox-community/netbox/issues/14249) - Fix server error when authenticating via IP-restricted API tokens using IPv6
17+
* [#14392](https://github.com/netbox-community/netbox/issues/14392) - Fix bulk operations for plugin models under admin UI
18+
* [#14397](https://github.com/netbox-community/netbox/issues/14397) - Fix exception on non-JSON request to `/available-ips/` API endpoints
19+
* [#14401](https://github.com/netbox-community/netbox/issues/14401) - Rack `starting_unit` cannot be zero
20+
* [#14432](https://github.com/netbox-community/netbox/issues/14432) - Populate custom field default values for components when creating a device
21+
* [#14448](https://github.com/netbox-community/netbox/issues/14448) - Fix exception when creating a power feed with rack and panel in different sites
22+
* [#14505](https://github.com/netbox-community/netbox/issues/14505) - Fix the assignment of tags to L2VPN terminations
23+
* [#14512](https://github.com/netbox-community/netbox/issues/14512) - Remove unneeded annotations from queries when using REST API brief mode
24+
* [#14515](https://github.com/netbox-community/netbox/issues/14515) - Ensure user config is created automatically for all user accounts
25+
* [#14522](https://github.com/netbox-community/netbox/issues/14522) - Fix filtering contact assignments by group
26+
* [#14533](https://github.com/netbox-community/netbox/issues/14533) - Fix quick search under VLAN group VLANs list
27+
28+
---
29+
330
## v3.6.6 (2023-11-29)
431

532
### Enhancements

netbox/circuits/forms/filtersets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ class CircuitFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFi
110110
(_('Tenant'), ('tenant_group_id', 'tenant_id')),
111111
(_('Contacts'), ('contact', 'contact_role', 'contact_group')),
112112
)
113+
selector_fields = ('filter_id', 'q', 'region_id', 'site_group_id', 'site_id', 'provider_id', 'provider_network_id')
113114
type_id = DynamicModelMultipleChoiceField(
114115
queryset=CircuitType.objects.all(),
115116
required=False,

netbox/dcim/forms/filtersets.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ class SiteFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
164164
(_('Tenant'), ('tenant_group_id', 'tenant_id')),
165165
(_('Contacts'), ('contact', 'contact_role', 'contact_group')),
166166
)
167+
selector_fields = ('filter_id', 'q', 'region_id', 'group_id')
167168
status = forms.MultipleChoiceField(
168169
label=_('Status'),
169170
choices=SiteStatusChoices,
@@ -247,6 +248,7 @@ class RackFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
247248
(_('Contacts'), ('contact', 'contact_role', 'contact_group')),
248249
(_('Weight'), ('weight', 'max_weight', 'weight_unit')),
249250
)
251+
selector_fields = ('filter_id', 'q', 'region_id', 'site_group_id', 'site_id', 'location_id')
250252
region_id = DynamicModelMultipleChoiceField(
251253
queryset=Region.objects.all(),
252254
required=False,
@@ -419,6 +421,7 @@ class DeviceTypeFilterForm(NetBoxModelFilterSetForm):
419421
)),
420422
(_('Weight'), ('weight', 'weight_unit')),
421423
)
424+
selector_fields = ('filter_id', 'q', 'manufacturer_id')
422425
manufacturer_id = DynamicModelMultipleChoiceField(
423426
queryset=Manufacturer.objects.all(),
424427
required=False,
@@ -543,6 +546,7 @@ class ModuleTypeFilterForm(NetBoxModelFilterSetForm):
543546
)),
544547
(_('Weight'), ('weight', 'weight_unit')),
545548
)
549+
selector_fields = ('filter_id', 'q', 'manufacturer_id')
546550
manufacturer_id = DynamicModelMultipleChoiceField(
547551
queryset=Manufacturer.objects.all(),
548552
required=False,
@@ -619,6 +623,7 @@ class DeviceRoleFilterForm(NetBoxModelFilterSetForm):
619623

620624
class PlatformFilterForm(NetBoxModelFilterSetForm):
621625
model = Platform
626+
selector_fields = ('filter_id', 'q', 'manufacturer_id')
622627
manufacturer_id = DynamicModelMultipleChoiceField(
623628
queryset=Manufacturer.objects.all(),
624629
required=False,
@@ -653,6 +658,7 @@ class DeviceFilterForm(
653658
'has_primary_ip', 'has_oob_ip', 'virtual_chassis_member', 'config_template_id', 'local_context_data',
654659
))
655660
)
661+
selector_fields = ('filter_id', 'q', 'region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')
656662
region_id = DynamicModelMultipleChoiceField(
657663
queryset=Region.objects.all(),
658664
required=False,
@@ -996,6 +1002,7 @@ class PowerPanelFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
9961002
(_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id')),
9971003
(_('Contacts'), ('contact', 'contact_role', 'contact_group')),
9981004
)
1005+
selector_fields = ('filter_id', 'q', 'site_id', 'location_id')
9991006
region_id = DynamicModelMultipleChoiceField(
10001007
queryset=Region.objects.all(),
10011008
required=False,
@@ -1227,6 +1234,7 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
12271234
(_('Device'), ('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', 'vdc_id')),
12281235
(_('Connection'), ('cabled', 'connected', 'occupied')),
12291236
)
1237+
selector_fields = ('filter_id', 'q', 'device_id')
12301238
vdc_id = DynamicModelMultipleChoiceField(
12311239
queryset=VirtualDeviceContext.objects.all(),
12321240
required=False,

netbox/dcim/migrations/0174_rack_starting_unit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Generated by Django 4.1.9 on 2023-05-31 15:47
22

3+
import django.core.validators
34
from django.db import migrations, models
45

56

@@ -12,6 +13,6 @@ class Migration(migrations.Migration):
1213
migrations.AddField(
1314
model_name='rack',
1415
name='starting_unit',
15-
field=models.PositiveSmallIntegerField(default=1),
16+
field=models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1)]),
1617
),
1718
]

netbox/dcim/models/devices.py

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

1717
from dcim.choices import *
1818
from dcim.constants import *
19-
from extras.models import ConfigContextModel
19+
from extras.models import ConfigContextModel, CustomField
2020
from extras.querysets import ConfigContextModelQuerySet
2121
from netbox.config import ConfigItem
2222
from netbox.models import OrganizationalModel, PrimaryModel
@@ -985,11 +985,17 @@ def _instantiate_components(self, queryset, bulk_create=True):
985985
bulk_create: If True, bulk_create() will be called to create all components in a single query
986986
(default). Otherwise, save() will be called on each instance individually.
987987
"""
988+
components = [obj.instantiate(device=self) for obj in queryset]
989+
if not components:
990+
return
991+
992+
# Set default values for any applicable custom fields
993+
model = queryset.model.component_model
994+
if cf_defaults := CustomField.objects.get_defaults_for_model(model):
995+
for component in components:
996+
component.custom_field_data = cf_defaults
997+
988998
if bulk_create:
989-
components = [obj.instantiate(device=self) for obj in queryset]
990-
if not components:
991-
return
992-
model = components[0]._meta.model
993999
model.objects.bulk_create(components)
9941000
# Manually send the post_save signal for each of the newly created components
9951001
for component in components:
@@ -1002,8 +1008,7 @@ def _instantiate_components(self, queryset, bulk_create=True):
10021008
update_fields=None
10031009
)
10041010
else:
1005-
for obj in queryset:
1006-
component = obj.instantiate(device=self)
1011+
for component in components:
10071012
component.save()
10081013

10091014
def save(self, *args, **kwargs):

netbox/dcim/models/power.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def clean(self):
175175
# Rack must belong to same Site as PowerPanel
176176
if self.rack and self.rack.site != self.power_panel.site:
177177
raise ValidationError(_(
178-
"Rack {rack} ({site}) and power panel {powerpanel} ({powerpanel_site}) are in different sites"
178+
"Rack {rack} ({rack_site}) and power panel {powerpanel} ({powerpanel_site}) are in different sites."
179179
).format(
180180
rack=self.rack,
181181
rack_site=self.rack.site,

netbox/dcim/models/racks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class Rack(ContactsMixin, ImageAttachmentsMixin, PrimaryModel, WeightMixin):
141141
starting_unit = models.PositiveSmallIntegerField(
142142
default=RACK_STARTING_UNIT_DEFAULT,
143143
verbose_name=_('starting unit'),
144+
validators=[MinValueValidator(1),],
144145
help_text=_('Starting unit for rack')
145146
)
146147
desc_units = models.BooleanField(

0 commit comments

Comments
 (0)