diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index b5de9bfee..2d6ca5700 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -14,7 +14,7 @@ body: attributes: label: NetBox version description: What version of NetBox are you currently running? - placeholder: v3.2.1 + placeholder: v3.2.2 validations: required: true - type: dropdown diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 138e0f9b4..13b162741 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -14,7 +14,7 @@ body: attributes: label: NetBox version description: What version of NetBox are you currently running? - placeholder: v3.2.1 + placeholder: v3.2.2 validations: required: true - type: dropdown diff --git a/base_requirements.txt b/base_requirements.txt index 4b814dbc7..095906914 100644 --- a/base_requirements.txt +++ b/base_requirements.txt @@ -68,8 +68,7 @@ gunicorn # Platform-agnostic template rendering engine # https://github.com/pallets/jinja -# Pin to v3.0 for mkdocstrings -Jinja2<3.1 +Jinja2 # Simple markup language for rendering HTML # https://github.com/Python-Markdown/markdown @@ -85,7 +84,7 @@ mkdocs-material # Introspection for embedded code # https://github.com/mkdocstrings/mkdocstrings -mkdocstrings<=0.17.0 +mkdocstrings[python-legacy] # Library for manipulating IP prefixes and addresses # https://github.com/netaddr/netaddr diff --git a/docs/release-notes/version-3.2.md b/docs/release-notes/version-3.2.md index d9c9ba737..1760d4d2e 100644 --- a/docs/release-notes/version-3.2.md +++ b/docs/release-notes/version-3.2.md @@ -1,6 +1,10 @@ # NetBox v3.2 -## v3.2.2 (FUTURE) +## v3.2.3 (FUTURE) + +--- + +## v3.2.2 (2022-04-28) ### Enhancements @@ -11,15 +15,19 @@ ### Bug Fixes +* [#4264](https://github.com/netbox-community/netbox/issues/4264) - Treat 0th IP as unusable for IPv6 prefixes (excluding /127s) * [#8941](https://github.com/netbox-community/netbox/issues/8941) - Fix dynamic dropdown behavior when browser is zoomed * [#8959](https://github.com/netbox-community/netbox/issues/8959) - Prevent exception when refreshing scripts list (avoid race condition) * [#9132](https://github.com/netbox-community/netbox/issues/9132) - Limit location options by selected site when creating a wireless link * [#9133](https://github.com/netbox-community/netbox/issues/9133) - Upgrade script should require Python 3.8 or later +* [#9138](https://github.com/netbox-community/netbox/issues/9138) - Avoid inadvertent form submission when utilizing quick search field on object lists * [#9151](https://github.com/netbox-community/netbox/issues/9151) - Child prefix counts not annotated on aggregates list under RIR view * [#9156](https://github.com/netbox-community/netbox/issues/9156) - Fix loading UserConfig data from fixtures * [#9158](https://github.com/netbox-community/netbox/issues/9158) - Do not list tags field for CSV forms which do not support tag assignment * [#9194](https://github.com/netbox-community/netbox/issues/9194) - Support position assignment when add module bays to multiple devices * [#9206](https://github.com/netbox-community/netbox/issues/9206) - Show header for comments field under module & module type creation views +* [#9222](https://github.com/netbox-community/netbox/issues/9222) - Fix circuit ID display under cable view +* [#9227](https://github.com/netbox-community/netbox/issues/9227) - Fix related object assignment when recording change record for interfaces --- diff --git a/netbox/dcim/models/device_components.py b/netbox/dcim/models/device_components.py index 3ed786000..a3b182da1 100644 --- a/netbox/dcim/models/device_components.py +++ b/netbox/dcim/models/device_components.py @@ -77,7 +77,7 @@ class ComponentModel(NetBoxModel): def to_objectchange(self, action): objectchange = super().to_objectchange(action) objectchange.related_object = self.device - return super().to_objectchange(action) + return objectchange @property def parent_object(self): diff --git a/netbox/ipam/models/ip.py b/netbox/ipam/models/ip.py index 9aec0cff8..a3b8fb2c1 100644 --- a/netbox/ipam/models/ip.py +++ b/netbox/ipam/models/ip.py @@ -507,16 +507,20 @@ class Prefix(GetAvailablePrefixesMixin, NetBoxModel): child_ranges.add(iprange.range) available_ips = prefix - child_ips - child_ranges - # IPv6, pool, or IPv4 /31-/32 sets are fully usable - if self.family == 6 or self.is_pool or (self.family == 4 and self.prefix.prefixlen >= 31): + # IPv6 /127's, pool, or IPv4 /31-/32 sets are fully usable + if (self.family == 6 and self.prefix.prefixlen >= 127) or self.is_pool or (self.family == 4 and self.prefix.prefixlen >= 31): return available_ips - # For "normal" IPv4 prefixes, omit first and last addresses - available_ips -= netaddr.IPSet([ - netaddr.IPAddress(self.prefix.first), - netaddr.IPAddress(self.prefix.last), - ]) - + if self.family == 4: + # For "normal" IPv4 prefixes, omit first and last addresses + available_ips -= netaddr.IPSet([ + netaddr.IPAddress(self.prefix.first), + netaddr.IPAddress(self.prefix.last), + ]) + else: + # For IPv6 prefixes, omit the Subnet-Router anycast address + # per RFC 4291 + available_ips -= netaddr.IPSet([netaddr.IPAddress(self.prefix.first)]) return available_ips def get_first_available_ip(self): diff --git a/netbox/ipam/tests/test_models.py b/netbox/ipam/tests/test_models.py index a664b34f4..09bc95799 100644 --- a/netbox/ipam/tests/test_models.py +++ b/netbox/ipam/tests/test_models.py @@ -185,6 +185,18 @@ class TestPrefix(TestCase): IPAddress.objects.create(address=IPNetwork('10.0.0.4/24')) self.assertEqual(parent_prefix.get_first_available_ip(), '10.0.0.5/24') + def test_get_first_available_ip_ipv6(self): + parent_prefix = Prefix.objects.create(prefix=IPNetwork('2001:db8:500::/64')) + self.assertEqual(parent_prefix.get_first_available_ip(), '2001:db8:500::1/64') + + def test_get_first_available_ip_ipv6_rfc3627(self): + parent_prefix = Prefix.objects.create(prefix=IPNetwork('2001:db8:500:4::/126')) + self.assertEqual(parent_prefix.get_first_available_ip(), '2001:db8:500:4::1/126') + + def test_get_first_available_ip_ipv6_rfc6164(self): + parent_prefix = Prefix.objects.create(prefix=IPNetwork('2001:db8:500:5::/127')) + self.assertEqual(parent_prefix.get_first_available_ip(), '2001:db8:500:5::/127') + def test_get_utilization_container(self): prefixes = ( Prefix(prefix=IPNetwork('10.0.0.0/24'), status=PrefixStatusChoices.STATUS_CONTAINER), diff --git a/netbox/templates/dcim/device/consoleports.html b/netbox/templates/dcim/device/consoleports.html index f96854ca8..afc306bd4 100644 --- a/netbox/templates/dcim/device/consoleports.html +++ b/netbox/templates/dcim/device/consoleports.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceConsolePortTable_config" %} +
{% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceConsolePortTable_config" %}
diff --git a/netbox/templates/dcim/device/consoleserverports.html b/netbox/templates/dcim/device/consoleserverports.html index eb27b4ab0..5f244cdc7 100644 --- a/netbox/templates/dcim/device/consoleserverports.html +++ b/netbox/templates/dcim/device/consoleserverports.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceConsoleServerPortTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceConsoleServerPortTable_config" %}
diff --git a/netbox/templates/dcim/device/devicebays.html b/netbox/templates/dcim/device/devicebays.html index 672cb192a..5e33bdae0 100644 --- a/netbox/templates/dcim/device/devicebays.html +++ b/netbox/templates/dcim/device/devicebays.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceDeviceBayTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceDeviceBayTable_config" %}
diff --git a/netbox/templates/dcim/device/frontports.html b/netbox/templates/dcim/device/frontports.html index 816d193de..0d0f9577c 100644 --- a/netbox/templates/dcim/device/frontports.html +++ b/netbox/templates/dcim/device/frontports.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceFrontPortTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceFrontPortTable_config" %}
diff --git a/netbox/templates/dcim/device/interfaces.html b/netbox/templates/dcim/device/interfaces.html index d7f8dff55..22f6d8be5 100644 --- a/netbox/templates/dcim/device/interfaces.html +++ b/netbox/templates/dcim/device/interfaces.html @@ -4,44 +4,46 @@ {% load static %} {% block content %} - - {% csrf_token %} -
-
-
- -
-
-
-
- {% if request.user.is_authenticated %} - - {% endif %} - - -
+
+
+
+
+
+
+ {% if request.user.is_authenticated %} + + {% endif %} + + +
+
+
+ + + {% csrf_token %} +
diff --git a/netbox/templates/dcim/device/inventory.html b/netbox/templates/dcim/device/inventory.html index c6452cf78..18a0712f3 100644 --- a/netbox/templates/dcim/device/inventory.html +++ b/netbox/templates/dcim/device/inventory.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceInventoryItemTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceInventoryItemTable_config" %}
diff --git a/netbox/templates/dcim/device/modulebays.html b/netbox/templates/dcim/device/modulebays.html index e9c672b57..fc1c9a60d 100644 --- a/netbox/templates/dcim/device/modulebays.html +++ b/netbox/templates/dcim/device/modulebays.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceModuleBayTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceModuleBayTable_config" %}
diff --git a/netbox/templates/dcim/device/poweroutlets.html b/netbox/templates/dcim/device/poweroutlets.html index 19d8298af..d312fbbd0 100644 --- a/netbox/templates/dcim/device/poweroutlets.html +++ b/netbox/templates/dcim/device/poweroutlets.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DevicePowerOutletTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DevicePowerOutletTable_config" %}
diff --git a/netbox/templates/dcim/device/powerports.html b/netbox/templates/dcim/device/powerports.html index 82c088392..cf71e81ba 100644 --- a/netbox/templates/dcim/device/powerports.html +++ b/netbox/templates/dcim/device/powerports.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DevicePowerPortTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DevicePowerPortTable_config" %}
diff --git a/netbox/templates/dcim/device/rearports.html b/netbox/templates/dcim/device/rearports.html index 868def466..73341990f 100644 --- a/netbox/templates/dcim/device/rearports.html +++ b/netbox/templates/dcim/device/rearports.html @@ -4,9 +4,10 @@ {% load helpers %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceRearPortTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceRearPortTable_config" %}
diff --git a/netbox/templates/dcim/inc/cable_termination.html b/netbox/templates/dcim/inc/cable_termination.html index f44c3b9d1..6d75aee85 100644 --- a/netbox/templates/dcim/inc/cable_termination.html +++ b/netbox/templates/dcim/inc/cable_termination.html @@ -32,7 +32,11 @@ Circuit - {{ termination.|linkify }} ({{ termination }}) + {{ termination.circuit|linkify }} + + + Termination + {{ termination }} {% endif %} diff --git a/netbox/templates/ipam/aggregate/prefixes.html b/netbox/templates/ipam/aggregate/prefixes.html index bb574ebf0..d1b48429a 100644 --- a/netbox/templates/ipam/aggregate/prefixes.html +++ b/netbox/templates/ipam/aggregate/prefixes.html @@ -12,9 +12,10 @@ {% endblock %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="PrefixTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="PrefixTable_config" %}
diff --git a/netbox/templates/ipam/iprange/ip_addresses.html b/netbox/templates/ipam/iprange/ip_addresses.html index a13910406..d9ac77fd0 100644 --- a/netbox/templates/ipam/iprange/ip_addresses.html +++ b/netbox/templates/ipam/iprange/ip_addresses.html @@ -10,9 +10,10 @@ {% endblock %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="IPAddressTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="IPAddressTable_config" %}
diff --git a/netbox/templates/ipam/prefix/ip_addresses.html b/netbox/templates/ipam/prefix/ip_addresses.html index b26375ebe..d734b825f 100644 --- a/netbox/templates/ipam/prefix/ip_addresses.html +++ b/netbox/templates/ipam/prefix/ip_addresses.html @@ -10,9 +10,10 @@ {% endblock %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="IPAddressTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="IPAddressTable_config" %}
diff --git a/netbox/templates/ipam/prefix/ip_ranges.html b/netbox/templates/ipam/prefix/ip_ranges.html index b262be821..268c290a1 100644 --- a/netbox/templates/ipam/prefix/ip_ranges.html +++ b/netbox/templates/ipam/prefix/ip_ranges.html @@ -10,9 +10,10 @@ {% endblock %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="IPRangeTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="IPRangeTable_config" %}
diff --git a/netbox/templates/ipam/prefix/prefixes.html b/netbox/templates/ipam/prefix/prefixes.html index 039b1ca3e..5d42596ba 100644 --- a/netbox/templates/ipam/prefix/prefixes.html +++ b/netbox/templates/ipam/prefix/prefixes.html @@ -12,9 +12,10 @@ {% endblock %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="PrefixTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="PrefixTable_config" %}
diff --git a/netbox/templates/ipam/vlan/interfaces.html b/netbox/templates/ipam/vlan/interfaces.html index 51df17edc..5707d5364 100644 --- a/netbox/templates/ipam/vlan/interfaces.html +++ b/netbox/templates/ipam/vlan/interfaces.html @@ -2,9 +2,10 @@ {% load helpers %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="VLANDevicesTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="VLANDevicesTable_config" %}
{% include 'htmx/table.html' %} diff --git a/netbox/templates/ipam/vlan/vminterfaces.html b/netbox/templates/ipam/vlan/vminterfaces.html index f12e9df86..ef4a0730a 100644 --- a/netbox/templates/ipam/vlan/vminterfaces.html +++ b/netbox/templates/ipam/vlan/vminterfaces.html @@ -2,9 +2,10 @@ {% load helpers %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="VLANVirtualMachinesTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="VLANVirtualMachinesTable_config" %}
{% include 'htmx/table.html' %} diff --git a/netbox/templates/virtualization/cluster/devices.html b/netbox/templates/virtualization/cluster/devices.html index 075f34c7e..cb4a1b3ee 100644 --- a/netbox/templates/virtualization/cluster/devices.html +++ b/netbox/templates/virtualization/cluster/devices.html @@ -3,9 +3,10 @@ {% load render_table from django_tables2 %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceTable_config" %}
{% include 'htmx/table.html' %} diff --git a/netbox/templates/virtualization/cluster/virtual_machines.html b/netbox/templates/virtualization/cluster/virtual_machines.html index 8b4191259..953d9f940 100644 --- a/netbox/templates/virtualization/cluster/virtual_machines.html +++ b/netbox/templates/virtualization/cluster/virtual_machines.html @@ -3,9 +3,10 @@ {% load render_table from django_tables2 %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="VirtualMachineTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="VirtualMachineTable_config" %}
{% include 'htmx/table.html' %} diff --git a/netbox/templates/virtualization/virtualmachine/interfaces.html b/netbox/templates/virtualization/virtualmachine/interfaces.html index de657b3b3..e3ffb84d4 100644 --- a/netbox/templates/virtualization/virtualmachine/interfaces.html +++ b/netbox/templates/virtualization/virtualmachine/interfaces.html @@ -3,9 +3,10 @@ {% load helpers %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="VirtualMachineVMInterfaceTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="VirtualMachineVMInterfaceTable_config" %}
diff --git a/requirements.txt b/requirements.txt index 35867410b..32c13d455 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,11 +15,11 @@ djangorestframework==3.13.1 drf-yasg[validation]==1.20.0 graphene-django==2.15.0 gunicorn==20.1.0 -Jinja2==3.0.3 +Jinja2==3.1.2 Markdown==3.3.6 markdown-include==0.6.0 -mkdocs-material==8.2.9 -mkdocstrings==0.17.0 +mkdocs-material==8.2.11 +mkdocstrings[python-legacy]==0.18.1 netaddr==0.8.0 Pillow==9.1.0 psycopg2-binary==2.9.3