Skip to content

Commit 25e67eb

Browse files
committed
Merge branch 'develop' into feature
2 parents 3068f2a + ec245b9 commit 25e67eb

File tree

40 files changed

+396
-85
lines changed

40 files changed

+396
-85
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: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,33 @@
11
# NetBox v3.6
22

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

532
---
633

netbox/circuits/forms/filtersets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class CircuitFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFi
119119
(_('Tenant'), ('tenant_group_id', 'tenant_id')),
120120
(_('Contacts'), ('contact', 'contact_role', 'contact_group')),
121121
)
122+
selector_fields = ('filter_id', 'q', 'region_id', 'site_group_id', 'site_id', 'provider_id', 'provider_network_id')
122123
type_id = DynamicModelMultipleChoiceField(
123124
queryset=CircuitType.objects.all(),
124125
required=False,

netbox/dcim/forms/filtersets.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ class SiteFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
165165
(_('Tenant'), ('tenant_group_id', 'tenant_id')),
166166
(_('Contacts'), ('contact', 'contact_role', 'contact_group')),
167167
)
168+
selector_fields = ('filter_id', 'q', 'region_id', 'group_id')
168169
status = forms.MultipleChoiceField(
169170
label=_('Status'),
170171
choices=SiteStatusChoices,
@@ -248,6 +249,7 @@ class RackFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
248249
(_('Contacts'), ('contact', 'contact_role', 'contact_group')),
249250
(_('Weight'), ('weight', 'max_weight', 'weight_unit')),
250251
)
252+
selector_fields = ('filter_id', 'q', 'region_id', 'site_group_id', 'site_id', 'location_id')
251253
region_id = DynamicModelMultipleChoiceField(
252254
queryset=Region.objects.all(),
253255
required=False,
@@ -420,6 +422,7 @@ class DeviceTypeFilterForm(NetBoxModelFilterSetForm):
420422
)),
421423
(_('Weight'), ('weight', 'weight_unit')),
422424
)
425+
selector_fields = ('filter_id', 'q', 'manufacturer_id')
423426
manufacturer_id = DynamicModelMultipleChoiceField(
424427
queryset=Manufacturer.objects.all(),
425428
required=False,
@@ -544,6 +547,7 @@ class ModuleTypeFilterForm(NetBoxModelFilterSetForm):
544547
)),
545548
(_('Weight'), ('weight', 'weight_unit')),
546549
)
550+
selector_fields = ('filter_id', 'q', 'manufacturer_id')
547551
manufacturer_id = DynamicModelMultipleChoiceField(
548552
queryset=Manufacturer.objects.all(),
549553
required=False,
@@ -620,6 +624,7 @@ class DeviceRoleFilterForm(NetBoxModelFilterSetForm):
620624

621625
class PlatformFilterForm(NetBoxModelFilterSetForm):
622626
model = Platform
627+
selector_fields = ('filter_id', 'q', 'manufacturer_id')
623628
manufacturer_id = DynamicModelMultipleChoiceField(
624629
queryset=Manufacturer.objects.all(),
625630
required=False,
@@ -654,6 +659,7 @@ class DeviceFilterForm(
654659
'has_primary_ip', 'has_oob_ip', 'virtual_chassis_member', 'config_template_id', 'local_context_data',
655660
))
656661
)
662+
selector_fields = ('filter_id', 'q', 'region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')
657663
region_id = DynamicModelMultipleChoiceField(
658664
queryset=Region.objects.all(),
659665
required=False,
@@ -997,6 +1003,7 @@ class PowerPanelFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm):
9971003
(_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id')),
9981004
(_('Contacts'), ('contact', 'contact_role', 'contact_group')),
9991005
)
1006+
selector_fields = ('filter_id', 'q', 'site_id', 'location_id')
10001007
region_id = DynamicModelMultipleChoiceField(
10011008
queryset=Region.objects.all(),
10021009
required=False,
@@ -1228,6 +1235,7 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
12281235
(_('Device'), ('device_type_id', 'device_role_id', 'device_id', 'virtual_chassis_id', 'vdc_id')),
12291236
(_('Connection'), ('cabled', 'connected', 'occupied')),
12301237
)
1238+
selector_fields = ('filter_id', 'q', 'device_id')
12311239
vdc_id = DynamicModelMultipleChoiceField(
12321240
queryset=VirtualDeviceContext.objects.all(),
12331241
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
@@ -994,11 +994,17 @@ def _instantiate_components(self, queryset, bulk_create=True):
994994
bulk_create: If True, bulk_create() will be called to create all components in a single query
995995
(default). Otherwise, save() will be called on each instance individually.
996996
"""
997+
components = [obj.instantiate(device=self) for obj in queryset]
998+
if not components:
999+
return
1000+
1001+
# Set default values for any applicable custom fields
1002+
model = queryset.model.component_model
1003+
if cf_defaults := CustomField.objects.get_defaults_for_model(model):
1004+
for component in components:
1005+
component.custom_field_data = cf_defaults
1006+
9971007
if bulk_create:
998-
components = [obj.instantiate(device=self) for obj in queryset]
999-
if not components:
1000-
return
1001-
model = components[0]._meta.model
10021008
model.objects.bulk_create(components)
10031009
# Manually send the post_save signal for each of the newly created components
10041010
for component in components:
@@ -1011,8 +1017,7 @@ def _instantiate_components(self, queryset, bulk_create=True):
10111017
update_fields=None
10121018
)
10131019
else:
1014-
for obj in queryset:
1015-
component = obj.instantiate(device=self)
1020+
for component in components:
10161021
component.save()
10171022

10181023
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)