From 83f520f7a8e640cb24890ade1e7cc413c527b917 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 21 Apr 2021 10:37:51 -0400 Subject: [PATCH 01/17] PRVB --- netbox/netbox/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index a7af4d8fd..d76960741 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -16,7 +16,7 @@ from django.core.validators import URLValidator # Environment setup # -VERSION = '2.11.1' +VERSION = '2.11.2-dev' # Hostname HOSTNAME = platform.node() From 396c91f8f79b6960906fa22ef4f494603f29b978 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Thu, 22 Apr 2021 14:05:07 -0400 Subject: [PATCH 02/17] Fixes #6246: Permit full-length descriptions when creating device components and VM interfaces --- docs/release-notes/version-2.11.md | 8 ++++++++ netbox/dcim/forms.py | 2 +- netbox/virtualization/forms.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 838022006..19e411d03 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -1,5 +1,13 @@ # NetBox v2.11 +## v2.11.2 (FUTURE) + +### Bug Fixes + +* [#6246](https://github.com/netbox-community/netbox/issues/6246) - Permit full-length descriptions when creating device components and VM interfaces + +--- + ## v2.11.1 (2021-04-21) ### Enhancements diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index d6799b6c9..51be3f269 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -2552,7 +2552,7 @@ class ComponentCreateForm(BootstrapMixin, CustomFieldForm, ComponentForm): queryset=Device.objects.all() ) description = forms.CharField( - max_length=100, + max_length=200, required=False ) tags = DynamicModelMultipleChoiceField( diff --git a/netbox/virtualization/forms.py b/netbox/virtualization/forms.py index 3da5c98d2..265674803 100644 --- a/netbox/virtualization/forms.py +++ b/netbox/virtualization/forms.py @@ -683,7 +683,7 @@ class VMInterfaceCreateForm(BootstrapMixin, InterfaceCommonForm): label='MAC Address' ) description = forms.CharField( - max_length=100, + max_length=200, required=False ) mode = forms.ChoiceField( From 648b9dd7d81b773258907e16a4d88e13ab3054c4 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Thu, 22 Apr 2021 14:11:58 -0400 Subject: [PATCH 03/17] Closes #6239: Fix sudo invokations of echo --- docs/installation/3-netbox.md | 4 ++-- docs/installation/6-ldap.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/installation/3-netbox.md b/docs/installation/3-netbox.md index 649898e0a..7a8e0bc80 100644 --- a/docs/installation/3-netbox.md +++ b/docs/installation/3-netbox.md @@ -198,7 +198,7 @@ All Python packages required by NetBox are listed in `requirements.txt` and will The [NAPALM automation](https://napalm-automation.net/) library allows NetBox to fetch live data from devices and return it to a requester via its REST API. The `NAPALM_USERNAME` and `NAPALM_PASSWORD` configuration parameters define the credentials to be used when connecting to a device. ```no-highlight -sudo echo napalm >> /opt/netbox/local_requirements.txt +sudo sh -c "echo 'napalm' >> /opt/netbox/local_requirements.txt" ``` ### Remote File Storage @@ -206,7 +206,7 @@ sudo echo napalm >> /opt/netbox/local_requirements.txt By default, NetBox will use the local filesystem to store uploaded files. To use a remote filesystem, install the [`django-storages`](https://django-storages.readthedocs.io/en/stable/) library and configure your [desired storage backend](../configuration/optional-settings.md#storage_backend) in `configuration.py`. ```no-highlight -sudo echo django-storages >> /opt/netbox/local_requirements.txt +sudo sh -c "echo 'django-storages' >> /opt/netbox/local_requirements.txt" ``` ## Run the Upgrade Script diff --git a/docs/installation/6-ldap.md b/docs/installation/6-ldap.md index 5d5135b33..27bdb0b40 100644 --- a/docs/installation/6-ldap.md +++ b/docs/installation/6-ldap.md @@ -30,7 +30,7 @@ pip3 install django-auth-ldap Once installed, add the package to `local_requirements.txt` to ensure it is re-installed during future rebuilds of the virtual environment: ```no-highlight -sudo echo django-auth-ldap >> /opt/netbox/local_requirements.txt +sudo sh -c "echo 'django-auth-ldap' >> /opt/netbox/local_requirements.txt" ``` ## Configuration From 1901e93b1e56a8ddf987ab4543e326fceed5ef24 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 23 Apr 2021 09:37:22 -0400 Subject: [PATCH 04/17] Fixes #6258: Fix parent assignment for SiteGroup API serializer --- docs/release-notes/version-2.11.md | 1 + netbox/dcim/api/serializers.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 19e411d03..38b2074bb 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -5,6 +5,7 @@ ### Bug Fixes * [#6246](https://github.com/netbox-community/netbox/issues/6246) - Permit full-length descriptions when creating device components and VM interfaces +* [#6258](https://github.com/netbox-community/netbox/issues/6258) - Fix parent assignment for SiteGroup API serializer --- diff --git a/netbox/dcim/api/serializers.py b/netbox/dcim/api/serializers.py index e9efe4136..377449140 100644 --- a/netbox/dcim/api/serializers.py +++ b/netbox/dcim/api/serializers.py @@ -90,7 +90,7 @@ class RegionSerializer(NestedGroupModelSerializer): class SiteGroupSerializer(NestedGroupModelSerializer): url = serializers.HyperlinkedIdentityField(view_name='dcim-api:sitegroup-detail') - parent = NestedRegionSerializer(required=False, allow_null=True) + parent = NestedSiteGroupSerializer(required=False, allow_null=True) site_count = serializers.IntegerField(read_only=True) class Meta: From 52747e364ae305631846e88a5229331e3dfeb059 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 23 Apr 2021 09:44:29 -0400 Subject: [PATCH 05/17] Fixes #6254: Disable ordering of space column in racks table --- docs/release-notes/version-2.11.md | 1 + netbox/dcim/tables/racks.py | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 38b2074bb..a9bad2c49 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -5,6 +5,7 @@ ### Bug Fixes * [#6246](https://github.com/netbox-community/netbox/issues/6246) - Permit full-length descriptions when creating device components and VM interfaces +* [#6254](https://github.com/netbox-community/netbox/issues/6254) - Disable ordering of space column in racks table * [#6258](https://github.com/netbox-community/netbox/issues/6258) - Fix parent assignment for SiteGroup API serializer --- diff --git a/netbox/dcim/tables/racks.py b/netbox/dcim/tables/racks.py index 3a63eef1e..ef0517dfc 100644 --- a/netbox/dcim/tables/racks.py +++ b/netbox/dcim/tables/racks.py @@ -73,6 +73,7 @@ class RackDetailTable(RackTable): verbose_name='Devices' ) get_utilization = UtilizationColumn( + orderable=False, verbose_name='Space' ) get_power_utilization = UtilizationColumn( From 4939b6b641020467a859b781e4de408647023d87 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 23 Apr 2021 10:07:11 -0400 Subject: [PATCH 06/17] Fixes #6252: Fix assignment of console port speed values above 19.2kbps --- docs/release-notes/version-2.11.md | 1 + .../dcim/migrations/0131_consoleport_speed.py | 21 +++++++++++++++++++ netbox/dcim/models/device_components.py | 4 ++-- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 netbox/dcim/migrations/0131_consoleport_speed.py diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index a9bad2c49..30319a483 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -5,6 +5,7 @@ ### Bug Fixes * [#6246](https://github.com/netbox-community/netbox/issues/6246) - Permit full-length descriptions when creating device components and VM interfaces +* [#6252](https://github.com/netbox-community/netbox/issues/6252) - Fix assignment of console port speed values above 19.2kbps * [#6254](https://github.com/netbox-community/netbox/issues/6254) - Disable ordering of space column in racks table * [#6258](https://github.com/netbox-community/netbox/issues/6258) - Fix parent assignment for SiteGroup API serializer diff --git a/netbox/dcim/migrations/0131_consoleport_speed.py b/netbox/dcim/migrations/0131_consoleport_speed.py new file mode 100644 index 000000000..350162218 --- /dev/null +++ b/netbox/dcim/migrations/0131_consoleport_speed.py @@ -0,0 +1,21 @@ +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dcim', '0130_sitegroup'), + ] + + operations = [ + migrations.AlterField( + model_name='consoleport', + name='speed', + field=models.PositiveIntegerField(blank=True, null=True), + ), + migrations.AlterField( + model_name='consoleserverport', + name='speed', + field=models.PositiveIntegerField(blank=True, null=True), + ), + ] diff --git a/netbox/dcim/models/device_components.py b/netbox/dcim/models/device_components.py index eda262a59..f2b13ed6f 100644 --- a/netbox/dcim/models/device_components.py +++ b/netbox/dcim/models/device_components.py @@ -222,7 +222,7 @@ class ConsolePort(ComponentModel, CableTermination, PathEndpoint): blank=True, help_text='Physical port type' ) - speed = models.PositiveSmallIntegerField( + speed = models.PositiveIntegerField( choices=ConsolePortSpeedChoices, blank=True, null=True, @@ -265,7 +265,7 @@ class ConsoleServerPort(ComponentModel, CableTermination, PathEndpoint): blank=True, help_text='Physical port type' ) - speed = models.PositiveSmallIntegerField( + speed = models.PositiveIntegerField( choices=ConsolePortSpeedChoices, blank=True, null=True, From 1dd9f8c1d45e600acd007a67bd127de6a99dfc71 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 23 Apr 2021 10:27:58 -0400 Subject: [PATCH 07/17] Fixes #6248: Fix table column reconfiguration under Chrome --- docs/release-notes/version-2.11.md | 1 + netbox/project-static/js/tableconfig.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 30319a483..4e415368e 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -5,6 +5,7 @@ ### Bug Fixes * [#6246](https://github.com/netbox-community/netbox/issues/6246) - Permit full-length descriptions when creating device components and VM interfaces +* [#6248](https://github.com/netbox-community/netbox/issues/6248) - Fix table column reconfiguration under Chrome * [#6252](https://github.com/netbox-community/netbox/issues/6252) - Fix assignment of console port speed values above 19.2kbps * [#6254](https://github.com/netbox-community/netbox/issues/6254) - Disable ordering of space column in racks table * [#6258](https://github.com/netbox-community/netbox/issues/6258) - Fix parent assignment for SiteGroup API serializer diff --git a/netbox/project-static/js/tableconfig.js b/netbox/project-static/js/tableconfig.js index 6851d2e8c..96474b3fe 100644 --- a/netbox/project-static/js/tableconfig.js +++ b/netbox/project-static/js/tableconfig.js @@ -2,7 +2,7 @@ $(document).ready(function() { // Select or reset table columns $('#save_tableconfig').click(function(event) { - $('select[name="columns"] option').attr("selected", "selected"); + $('select[name="columns"] option').prop("selected", "selected"); }); $('#reset_tableconfig').click(function(event) { $('select[name="columns"]').val([]); From 2618dde1e2837fd4c587bed89d2358199176f01e Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 23 Apr 2021 15:27:58 -0400 Subject: [PATCH 08/17] Fixes #6236: Journal entry title should account for configured timezone --- docs/release-notes/version-2.11.md | 1 + netbox/extras/models/models.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 4e415368e..528978b06 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -4,6 +4,7 @@ ### Bug Fixes +* [#6236](https://github.com/netbox-community/netbox/issues/6236) - Journal entry title should account for configured timezone * [#6246](https://github.com/netbox-community/netbox/issues/6246) - Permit full-length descriptions when creating device components and VM interfaces * [#6248](https://github.com/netbox-community/netbox/issues/6248) - Fix table column reconfiguration under Chrome * [#6252](https://github.com/netbox-community/netbox/issues/6252) - Fix assignment of console port speed values above 19.2kbps diff --git a/netbox/extras/models/models.py b/netbox/extras/models/models.py index b3bc7f535..c2cebe163 100644 --- a/netbox/extras/models/models.py +++ b/netbox/extras/models/models.py @@ -431,7 +431,9 @@ class JournalEntry(ChangeLoggedModel): verbose_name_plural = 'journal entries' def __str__(self): - return f"{date_format(self.created)} - {time_format(self.created)} ({self.get_kind_display()})" + created_date = timezone.localdate(self.created) + created_time = timezone.localtime(self.created) + return f"{date_format(created_date)} - {time_format(created_time)} ({self.get_kind_display()})" def get_absolute_url(self): return reverse('extras:journalentry', args=[self.pk]) From 19a2b9042fff08ffd03f4519e6810a0865eeede2 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 26 Apr 2021 15:28:35 -0400 Subject: [PATCH 09/17] Closes #6275: Linkify rack, device counts on locations list --- docs/release-notes/version-2.11.md | 4 ++++ netbox/dcim/tables/sites.py | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 528978b06..121b440a0 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -2,6 +2,10 @@ ## v2.11.2 (FUTURE) +### Enhancements + +* [#6275](https://github.com/netbox-community/netbox/issues/6275) - Linkify rack, device counts on locations list + ### Bug Fixes * [#6236](https://github.com/netbox-community/netbox/issues/6236) - Journal entry title should account for configured timezone diff --git a/netbox/dcim/tables/sites.py b/netbox/dcim/tables/sites.py index b7d46eba5..47c912354 100644 --- a/netbox/dcim/tables/sites.py +++ b/netbox/dcim/tables/sites.py @@ -102,10 +102,14 @@ class LocationTable(BaseTable): site = tables.Column( linkify=True ) - rack_count = tables.Column( + rack_count = LinkedCountColumn( + viewname='dcim:rack_list', + url_params={'location_id': 'pk'}, verbose_name='Racks' ) - device_count = tables.Column( + device_count = LinkedCountColumn( + viewname='dcim:device_list', + url_params={'location_id': 'pk'}, verbose_name='Devices' ) actions = ButtonsColumn( From 87b4cfff1aaf57cb3913209f25d770d7820ef9e1 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 26 Apr 2021 15:31:53 -0400 Subject: [PATCH 10/17] Closes #6278: Note device locations on cable traces --- docs/release-notes/version-2.11.md | 1 + netbox/templates/dcim/trace/device.html | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 121b440a0..446a1fb57 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -5,6 +5,7 @@ ### Enhancements * [#6275](https://github.com/netbox-community/netbox/issues/6275) - Linkify rack, device counts on locations list +* [#6278](https://github.com/netbox-community/netbox/issues/6278) - Note device locations on cable traces ### Bug Fixes diff --git a/netbox/templates/dcim/trace/device.html b/netbox/templates/dcim/trace/device.html index c3696e786..b1d37b76c 100644 --- a/netbox/templates/dcim/trace/device.html +++ b/netbox/templates/dcim/trace/device.html @@ -2,6 +2,9 @@ {{ device }}
{{ device.device_type.manufacturer }} {{ device.device_type }}
{{ device.site }} + {% if device.location %} + / {{ device.location }} + {% endif %} {% if device.rack %} / {{ device.rack }} {% endif %} From 9e5d41c48af5d5b93e1c23973300e524a6e46f2b Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 26 Apr 2021 15:55:53 -0400 Subject: [PATCH 11/17] Remove myself from funding --- .github/FUNDING.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 5b4e4e5a4..000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: [jeremystretch] From fecca5ad83fb6b48a2f15982dfd3242653f105f9 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 26 Apr 2021 16:49:52 -0400 Subject: [PATCH 12/17] Fixes #6267: Fix cable tracing API endpoint for circuit terminations --- docs/release-notes/version-2.11.md | 2 ++ netbox/circuits/api/views.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 446a1fb57..5b80daccd 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -15,6 +15,7 @@ * [#6252](https://github.com/netbox-community/netbox/issues/6252) - Fix assignment of console port speed values above 19.2kbps * [#6254](https://github.com/netbox-community/netbox/issues/6254) - Disable ordering of space column in racks table * [#6258](https://github.com/netbox-community/netbox/issues/6258) - Fix parent assignment for SiteGroup API serializer +* [#6267](https://github.com/netbox-community/netbox/issues/6267) - Fix cable tracing API endpoint for circuit terminations --- @@ -193,6 +194,7 @@ A new provider network model has been introduced to represent the boundary of a * circuits.CircuitTermination * Added the `provider_network` field * Removed the `connected_endpoint`, `connected_endpoint_type`, and `connected_endpoint_reachable` fields + * The `trace/` endpoint has been replaced with `paths/` * circuits.ProviderNetwork * Added the `/api/circuits/provider-networks/` endpoint * dcim.Device diff --git a/netbox/circuits/api/views.py b/netbox/circuits/api/views.py index c037bc5fd..0ea8d1973 100644 --- a/netbox/circuits/api/views.py +++ b/netbox/circuits/api/views.py @@ -2,7 +2,7 @@ from rest_framework.routers import APIRootView from circuits import filters from circuits.models import * -from dcim.api.views import PathEndpointMixin +from dcim.api.views import PassThroughPortMixin from extras.api.views import CustomFieldModelViewSet from netbox.api.views import ModelViewSet from utilities.utils import count_related @@ -57,7 +57,7 @@ class CircuitViewSet(CustomFieldModelViewSet): # Circuit Terminations # -class CircuitTerminationViewSet(PathEndpointMixin, ModelViewSet): +class CircuitTerminationViewSet(PassThroughPortMixin, ModelViewSet): queryset = CircuitTermination.objects.prefetch_related( 'circuit', 'site', 'provider_network', 'cable' ) From f408ad16e446671e353ad9f69548c174a1a97ee3 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 27 Apr 2021 08:34:21 -0400 Subject: [PATCH 13/17] Closes #6287: Add option to clear assigned max length filter on prefixes list --- docs/release-notes/version-2.11.md | 1 + netbox/templates/ipam/prefix_list.html | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 5b80daccd..73ca3982a 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -6,6 +6,7 @@ * [#6275](https://github.com/netbox-community/netbox/issues/6275) - Linkify rack, device counts on locations list * [#6278](https://github.com/netbox-community/netbox/issues/6278) - Note device locations on cable traces +* [#6287](https://github.com/netbox-community/netbox/issues/6287) - Add option to clear assigned max length filter on prefixes list ### Bug Fixes diff --git a/netbox/templates/ipam/prefix_list.html b/netbox/templates/ipam/prefix_list.html index fc3fadaee..e6e2abca4 100644 --- a/netbox/templates/ipam/prefix_list.html +++ b/netbox/templates/ipam/prefix_list.html @@ -9,6 +9,11 @@