MFH: r521755

net-mgmt/netbox: Update to 2.6.9

* Remove two backported patches that are no longer required. [1]
* Backport a patch from upstream that fixes a regression when accessing the
  API documentation.
* Update the WWW field.

Changelog:

Enhancements:
* Include direct link to rack elevations on site view
* Move virtual machine results near devices in global search
* Added copy button for API tokens

Bug Fixes:
* Prevent the deletion of a virtual chassis when a cross-member LAG
  is present
* Respect custom field default values when creating objects via the REST API
* Fix exception on password change page for local users [1]
* Fix unable to assign IP to interface [1]

Approved by:	ports-secteam (joneum)
This commit is contained in:
Kai Knoblich 2020-01-02 23:52:23 +00:00
parent 4194769133
commit ffaa90de5a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2020Q1/; revision=521889
6 changed files with 23 additions and 42 deletions

View File

@ -2,8 +2,7 @@
PORTNAME= netbox
DISTVERSIONPREFIX= v
DISTVERSION= 2.6.8
PORTREVISION= 1
DISTVERSION= 2.6.9
CATEGORIES= net-mgmt
MAINTAINER= kai@FreeBSD.org

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1575996489
SHA256 (netbox-community-netbox-v2.6.8_GH0.tar.gz) = fb146bdb0369e59034f24b1523ec5025575b3fb9ad473896fd43fc9faffdc9b0
SIZE (netbox-community-netbox-v2.6.8_GH0.tar.gz) = 2416523
TIMESTAMP = 1576569679
SHA256 (netbox-community-netbox-v2.6.9_GH0.tar.gz) = 82b993a4002ad68f0d572591f81958aa88a37244c9d76646c01c210fdd57bdb9
SIZE (netbox-community-netbox-v2.6.9_GH0.tar.gz) = 2417598

View File

@ -0,0 +1,18 @@
Fix AttributeError exception in API docs when accessing api/docs
Obtained from:
https://github.com/netbox-community/netbox/commit/55b503da5bdf2a95e903fb657ade195ff89cae91
--- netbox/extras/api/customfields.py.orig 2019-12-16 21:32:00 UTC
+++ netbox/extras/api/customfields.py
@@ -124,6 +124,9 @@ class CustomFieldModelSerializer(ValidatedModelSeriali
else:
+ if not hasattr(self, 'initial_data'):
+ self.initial_data = {}
+
# Populate default values
if fields and 'custom_fields' not in self.initial_data:
self.initial_data['custom_fields'] = {}

View File

@ -1,20 +0,0 @@
Fix unable to assign existing IP addresses to interfaces
Obtained from:
https://github.com/netbox-community/netbox/commit/1acdf58a4bb35d83a280464ac69aa961ff614df7
--- netbox/ipam/tables.py.orig 2019-12-15 11:43:12 UTC
+++ netbox/ipam/tables.py
@@ -85,7 +85,11 @@ IPADDRESS_LINK = """
"""
IPADDRESS_ASSIGN_LINK = """
-<a href="{% url 'ipam:ipaddress_edit' pk=record.pk %}?interface={{ record.interface.pk }}&return_url={{ request.path }}">{{ record }}</a>
+{% if request.GET %}
+ <a href="{% url 'ipam:ipaddress_edit' pk=record.pk %}?interface={{ request.GET.interface }}&return_url={{ request.GET.return_url }}">{{ record }}</a>
+{% else %}
+ <a href="{% url 'ipam:ipaddress_edit' pk=record.pk %}?interface={{ record.interface.pk }}&return_url={{ request.path }}">{{ record }}</a>
+{% endif %}
"""
IPADDRESS_PARENT = """

View File

@ -1,16 +0,0 @@
Fix exception on password change page for local users
Obtained from:
https://github.com/netbox-community/netbox/commit/3b03d68ac70be1b5b9912d0a4d2a5fecd25cede4
--- netbox/users/views.py.orig 2019-12-10 15:47:48 UTC
+++ netbox/users/views.py
@@ -96,7 +96,7 @@ class ChangePasswordView(LoginRequiredMixin, View):
def get(self, request):
# LDAP users cannot change their password here
- if getattr(request.user, 'ldap_username'):
+ if getattr(request.user, 'ldap_username', None):
messages.warning(request, "LDAP-authenticated user credentials cannot be changed within NetBox.")
return redirect('user:profile')

View File

@ -12,4 +12,4 @@ management:
- Data circuits - Long-haul communications circuits and providers
- Secrets - Encrypted storage of sensitive credentials
WWW: https://github.com/digitalocean/netbox
WWW: https://github.com/netbox-community/netbox