Skip to content

Commit 0e23038

Browse files
committed
Merge v2.11.5
2 parents 2d44bad + 0783d57 commit 0e23038

File tree

12 files changed

+26
-31
lines changed

12 files changed

+26
-31
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ body:
1717
What version of NetBox are you currently running? (If you don't have access to the most
1818
recent NetBox release, consider testing on our [demo instance](https://demo.netbox.dev/)
1919
before opening a bug report to see if your issue has already been addressed.)
20-
placeholder: v2.11.4
20+
placeholder: v2.11.5
2121
validations:
2222
required: true
2323
- 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: v2.11.4
17+
placeholder: v2.11.5
1818
validations:
1919
required: true
2020
- type: dropdown

docs/additional-features/reports.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class DeviceConnectionsReport(Report):
8080
self.log_success(device)
8181
```
8282

83-
As you can see, reports are completely customizable. Validation logic can be as simple or as complex as needed.
83+
As you can see, reports are completely customizable. Validation logic can be as simple or as complex as needed. Also note that the `description` attribute support markdown syntax. It will be rendered in the report list page.
8484

8585
!!! warning
8686
Reports should never alter data: If you find yourself using the `create()`, `save()`, `update()`, or `delete()` methods on objects within reports, stop and re-evaluate what you're trying to accomplish. Note that there are no safeguards against the accidental alteration or destruction of data.
@@ -93,7 +93,7 @@ The following methods are available to log results within a report:
9393
* log_warning(object, message)
9494
* log_failure(object, message)
9595

96-
The recording of one or more failure messages will automatically flag a report as failed. It is advised to log a success for each object that is evaluated so that the results will reflect how many objects are being reported on. (The inclusion of a log message is optional for successes.) Messages recorded with `log()` will appear in a report's results but are not associated with a particular object or status.
96+
The recording of one or more failure messages will automatically flag a report as failed. It is advised to log a success for each object that is evaluated so that the results will reflect how many objects are being reported on. (The inclusion of a log message is optional for successes.) Messages recorded with `log()` will appear in a report's results but are not associated with a particular object or status. Log messages also support using markdown syntax and will be rendered on the report result page.
9797

9898
To perform additional tasks, such as sending an email or calling a webhook, after a report has been run, extend the `post_run()` method. The status of the report is available as `self.failed` and the results object is `self.result`.
9999

docs/release-notes/version-2.11.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# NetBox v2.11
22

3-
## v2.11.5 (FUTURE)
3+
## v2.11.5 (2021-06-04)
4+
5+
**NOTE:** This release includes a database migration that calculates and annotates prefix depth. It may impose a noticeable delay on the upgrade process: Users should anticipate roughly one minute of delay per 100 thousand prefixes being updated.
46

57
### Enhancements
68

79
* [#6087](https://github.com/netbox-community/netbox/issues/6087) - Improved prefix hierarchy rendering
810
* [#6487](https://github.com/netbox-community/netbox/issues/6487) - Add location filter to cable connection form
911
* [#6501](https://github.com/netbox-community/netbox/issues/6501) - Expose prefix depth and children on REST API serializer
12+
* [#6527](https://github.com/netbox-community/netbox/issues/6527) - Support Markdown for report descriptions
13+
* [#6540](https://github.com/netbox-community/netbox/issues/6540) - Add a "flat" column to the prefix table
1014

1115
### Bug Fixes
1216

netbox/ipam/api/serializers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ class IPAddressSerializer(PrimaryModelSerializer):
273273
)
274274
assigned_object = serializers.SerializerMethodField(read_only=True)
275275
nat_inside = NestedIPAddressSerializer(required=False, allow_null=True)
276-
nat_outside = NestedIPAddressSerializer(read_only=True)
276+
nat_outside = NestedIPAddressSerializer(required=False, read_only=True)
277277

278278
class Meta:
279279
model = IPAddress
@@ -282,7 +282,7 @@ class Meta:
282282
'assigned_object_id', 'assigned_object', 'nat_inside', 'nat_outside', 'dns_name', 'description', 'tags',
283283
'custom_fields', 'created', 'last_updated',
284284
]
285-
read_only_fields = ['family']
285+
read_only_fields = ['family', 'nat_outside']
286286

287287
@swagger_serializer_method(serializer_or_field=serializers.DictField)
288288
def get_assigned_object(self, obj):

netbox/ipam/migrations/0048_prefix_populate_depth_children.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@
44
from ipam.utils import rebuild_prefixes
55

66

7-
def push_to_stack(stack, prefix):
8-
# Increment child count on parent nodes
9-
for n in stack:
10-
n['children'] += 1
11-
stack.append({
12-
'pk': prefix['pk'],
13-
'prefix': prefix['prefix'],
14-
'children': 0,
15-
})
16-
17-
187
def populate_prefix_hierarchy(apps, schema_editor):
198
"""
209
Populate _depth and _children attrs for all Prefixes.

netbox/ipam/tables.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ class PrefixTable(BaseTable):
277277
template_code=PREFIX_LINK,
278278
attrs={'td': {'class': 'text-nowrap'}}
279279
)
280+
prefix_flat = tables.Column(
281+
accessor=Accessor('prefix'),
282+
linkify=True,
283+
verbose_name='Prefix (Flat)'
284+
)
280285
depth = tables.Column(
281286
accessor=Accessor('_depth'),
282287
verbose_name='Depth'
@@ -318,8 +323,8 @@ class PrefixTable(BaseTable):
318323
class Meta(BaseTable.Meta):
319324
model = Prefix
320325
fields = (
321-
'pk', 'prefix', 'status', 'depth', 'children', 'vrf', 'tenant', 'site', 'vlan', 'role', 'is_pool',
322-
'mark_utilized', 'description',
326+
'pk', 'prefix', 'prefix_flat', 'status', 'depth', 'children', 'vrf', 'tenant', 'site', 'vlan', 'role',
327+
'is_pool', 'mark_utilized', 'description',
323328
)
324329
default_columns = ('pk', 'prefix', 'status', 'vrf', 'tenant', 'site', 'vlan', 'role', 'description')
325330
row_attrs = {
@@ -332,15 +337,14 @@ class PrefixDetailTable(PrefixTable):
332337
accessor='get_utilization',
333338
orderable=False
334339
)
335-
tenant = TenantColumn()
336340
tags = TagColumn(
337341
url_name='ipam:prefix_list'
338342
)
339343

340344
class Meta(PrefixTable.Meta):
341345
fields = (
342-
'pk', 'prefix', 'status', 'children', 'vrf', 'utilization', 'tenant', 'site', 'vlan', 'role', 'is_pool',
343-
'mark_utilized', 'description', 'tags',
346+
'pk', 'prefix', 'prefix_flat', 'status', 'children', 'vrf', 'utilization', 'tenant', 'site', 'vlan', 'role',
347+
'is_pool', 'mark_utilized', 'description', 'tags',
344348
)
345349
default_columns = (
346350
'pk', 'prefix', 'status', 'children', 'vrf', 'utilization', 'tenant', 'site', 'vlan', 'role', 'description',

netbox/netbox/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Environment setup
1717
#
1818

19-
VERSION = '2.12-beta1'
19+
VERSION = '3.0-beta1'
2020

2121
# Hostname
2222
HOSTNAME = platform.node()

netbox/netbox/views/generic.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,9 +774,7 @@ def post(self, request, **kwargs):
774774

775775
# If we are editing *all* objects in the queryset, replace the PK list with all matched objects.
776776
if request.POST.get('_all') and self.filterset is not None:
777-
pk_list = [
778-
obj.pk for obj in self.filterset(request.GET, self.queryset.only('pk')).qs
779-
]
777+
pk_list = self.filterset(request.GET, self.queryset.values_list('pk', flat=True)).qs
780778
else:
781779
pk_list = request.POST.getlist('pk')
782780

netbox/templates/extras/report.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
{% block content %}
1313
{% if report.description %}
14-
<p class="text-muted">{{ report.description }}</p>
14+
<p class="text-muted">{{ report.description|render_markdown }}</p>
1515
{% endif %}
1616
{% if perms.extras.run_report %}
1717
<div class="float-end noprint">

netbox/templates/extras/report_list.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% if reports %}
1010
{% for module, module_reports in reports %}
1111
<div class="card">
12-
<h5 class="card-header"><a name="module.{{ module }}"></a>{{ module|bettertitle }}</h3>
12+
<h5 class="card-header"><a name="module.{{ module }}"></a>{{ module|bettertitle }}</h5>
1313
<div class="card-body">
1414
<table class="table table-hover table-headings reports">
1515
<thead>
@@ -32,7 +32,7 @@ <h5 class="card-header"><a name="module.{{ module }}"></a>{{ module|bettertitle
3232
<td>
3333
{% include 'extras/inc/job_label.html' with result=report.result %}
3434
</td>
35-
<td>{{ report.description|placeholder }}</td>
35+
<td>{{ report.description|render_markdown|placeholder }}</td>
3636
<td class="text-end">
3737
{% if report.result %}
3838
<a href="{% url 'extras:report_result' job_result_pk=report.result.pk %}">{{ report.result.created }}</a>

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Django==3.2.3
1+
Django==3.2.4
22
django-cacheops==6.0
33
django-cors-headers==3.7.0
44
django-debug-toolbar==3.2.1

0 commit comments

Comments
 (0)