From nobody Wed Feb 22 07:16:42 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PM6sQ2Kpdz3sfmt; Wed, 22 Feb 2023 07:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PM6sQ1kBHz4D50; Wed, 22 Feb 2023 07:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677050202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BozftxAn6UN84jm5LPcsHq4AAEgi/vz8AWDx27VMkII=; b=F9mAm/SA3Q2po2FnlrD6/cx/U+ydlvW9uKk7CINKMPu0wjn5D1zaRCmEdDO4Ps6F8FmA83 nYWgjYabVw7y+ywLKLT9MqRhycOTyGflfRKLubgVCxzAraLYsFR+On0tapEDvw8tcS484M A1oYjj7fWGpsNg21PX1nLGMgolSSTHGMlJlMb19vR+0J8nv41Ou2W0VpYVbK0D48WrOttR xaQ1ldZWQfiGSnSPvXLfJgWn5GbHWId7qYUDpoOQkdjggNbNg2wNUtmJZ4a74859lrtPJ3 9v7s2Hl8eJkP0O5/28pePRu0f4vZl3JDR5dFErT/Ecalszw//Tl6u7h/IR97/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677050202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BozftxAn6UN84jm5LPcsHq4AAEgi/vz8AWDx27VMkII=; b=jMeE+KJRrWy1uJMn2Jzeh6eTJbGcsfEOGabEOlB039sly+x1S08BDC7CIlpG+Emc7iq7oE VQ7GkpN8RWL6dIxuHOO9qc11YVntFSWZvTouXcQLEtmR2yfkodje8PHdTcvOWf8qYr8x9W AsOsp/s0s1J1QhXQK1F8q+WJ+mnn384nMBxaL7ME1zt3KiNSnGddeqwi1DAFrAb+4c1UJU TNtj0WIrtenFkHOQfgOvBrhEEvYJROLtFcPfmo6Q9gC9Wn5csf1hrXm6F/k9UoRYyPNwIE nzSN4tkxNj0T8EmhjmSpvdJIVlUm55JlwMz37ZZQNqcsf4AV/E9w9owZd9jUQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677050202; a=rsa-sha256; cv=none; b=JC8Wtwcs/ejrSB9zT69hz1QTCxCI9nNOrj/VKSmF2ZTJ3xrAzPkC7JaOSBmqbQzbmsBkq7 jDC82yu67V1bP7iWPGLLUEde6gAmEZnNQB5ODpvCpmRa8mzrrcJr22XJuNe8f2nFUiFvUt x/L6UJ7FrPZMKourqLt5Mt708WHV/drg/q0QIXqG7WyQqEwfKBnQ38VzUe73S/lG/b1U6H hqgDZZ/tGN3SN2jQjZVK0toJrDp9oFvB9NCuDJhvKcKNFJZ56/i7eg5fZFDsibIGJ8GKoM n7m4DblhCZr1gsw+xIpGSEHCxWZ4dN1kqOuck3u/qiEq5xatQkb54UkVIOkCmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PM6sQ0lrGzsDJ; Wed, 22 Feb 2023 07:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31M7Ggeo099938; Wed, 22 Feb 2023 07:16:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31M7GgDS099937; Wed, 22 Feb 2023 07:16:42 GMT (envelope-from git) Date: Wed, 22 Feb 2023 07:16:42 GMT Message-Id: <202302220716.31M7GgDS099937@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Kai Knoblich Subject: git: d1245d52448d - 2023Q1 - net-mgmt/py-phonebox-plugin: Fix runtime with NetBox 3.3+ List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kai X-Git-Repository: ports X-Git-Refname: refs/heads/2023Q1 X-Git-Reftype: branch X-Git-Commit: d1245d52448dce5562bbe996333288bba693a79e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch 2023Q1 has been updated by kai: URL: https://cgit.FreeBSD.org/ports/commit/?id=d1245d52448dce5562bbe996333288bba693a79e commit d1245d52448dce5562bbe996333288bba693a79e Author: Kai Knoblich AuthorDate: 2023-02-22 06:53:06 +0000 Commit: Kai Knoblich CommitDate: 2023-02-22 07:16:21 +0000 net-mgmt/py-phonebox-plugin: Fix runtime with NetBox 3.3+ * Add a workaround as NetBox 3.3 introduced some API changes which break the plugin and since NetBox 3.4 two templates need some modifications as well to work properly. * Bump PORTREVISION due package change. MFH: 2023Q1 (cherry picked from commit 6f053b32fca6ade8b6fb488a085e2a09cc922957) --- net-mgmt/py-phonebox-plugin/Makefile | 1 + .../patch-fix-runtime-with-netbox-3.3-and-later | 187 +++++++++++++++++++++ 2 files changed, 188 insertions(+) diff --git a/net-mgmt/py-phonebox-plugin/Makefile b/net-mgmt/py-phonebox-plugin/Makefile index 188c1f8e83ab..545402ece536 100644 --- a/net-mgmt/py-phonebox-plugin/Makefile +++ b/net-mgmt/py-phonebox-plugin/Makefile @@ -1,5 +1,6 @@ PORTNAME= phonebox-plugin DISTVERSION= 0.0.4b1 +PORTREVISION= 1 CATEGORIES= net-mgmt python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff --git a/net-mgmt/py-phonebox-plugin/files/patch-fix-runtime-with-netbox-3.3-and-later b/net-mgmt/py-phonebox-plugin/files/patch-fix-runtime-with-netbox-3.3-and-later new file mode 100644 index 000000000000..b04dd8661c77 --- /dev/null +++ b/net-mgmt/py-phonebox-plugin/files/patch-fix-runtime-with-netbox-3.3-and-later @@ -0,0 +1,187 @@ +Fix runtime issues with NetBox 3.3+ + +See also: + +https://github.com/iDebugAll/phonebox_plugin/issues/27 +https://github.com/iDebugAll/phonebox_plugin/pull/28 + +--- MANIFEST.in.orig 2023-02-21 21:36:03 UTC ++++ MANIFEST.in +@@ -1,4 +1,5 @@ recursive-include phonebox_plugin/templates * + include README.md + include LICENSE + recursive-include phonebox_plugin/templates * ++recursive-exclude phonebox_plugin/templates *.orig .DS_Store + recursive-include phonebox_plugin/static * +--- phonebox_plugin/api/nested_serializers.py.orig 2021-09-21 14:31:12 UTC ++++ phonebox_plugin/api/nested_serializers.py +@@ -1,6 +1,12 @@ from phonebox_plugin import models + from rest_framework import serializers + from phonebox_plugin import models +-from netbox.api import WritableNestedSerializer ++ ++try: ++ from netbox.api import ChoiceField, WritableNestedSerializer ++except ImportError: ++ from netbox.api.fields import ChoiceField ++ from netbox.api.serializers.nested import WritableNestedSerializer ++ + from tenancy.api.nested_serializers import NestedTenantSerializer + + __all__ = ["NestedNumberSerializer", ] +--- phonebox_plugin/templates/phonebox_plugin/list_view_3.4.html.orig 2023-02-21 21:32:23 UTC ++++ phonebox_plugin/templates/phonebox_plugin/list_view_3.4.html +@@ -0,0 +1,62 @@ ++{% extends 'base/layout.html' %} ++{% load buttons %} ++{% load static %} ++{% load plugins %} ++{% load helpers %} ++ ++ ++{% block controls %} ++ ++
++ {% if perms.phonebox_plugin.add_number %} ++ ++ Add ++ ++ {% endif %} ++ {% if perms.phonebox_plugin.add_number %} ++ ++ Import ++ ++ {% endif %} ++
++ ++{% endblock %} ++ ++ ++{% block content %} ++ ++ ++ ++
++
++ ++ {# Applied filters #} ++ {% if filter_form %} ++ {% applied_filters model filter_form request.GET %} ++ {% endif %} ++ ++

{% block title %}Numbers{% endblock %}

++
++
++ {% include 'phonebox_plugin/obj_table.html' with bulk_delete_url="plugins:phonebox_plugin:number_bulk_delete" bulk_edit_url="plugins:phonebox_plugin:number_bulk_edit" %} ++
++
++
++
++ {% include 'inc/filter_list.html' %} ++
++
++ ++{% endblock %} +--- phonebox_plugin/templates/phonebox_plugin/voice_circuit_list_view_3.4.html.orig 2023-02-21 21:32:23 UTC ++++ phonebox_plugin/templates/phonebox_plugin/voice_circuit_list_view_3.4.html +@@ -0,0 +1,62 @@ ++{% extends 'base/layout.html' %} ++{% load buttons %} ++{% load static %} ++{% load plugins %} ++{% load helpers %} ++ ++ ++{% block controls %} ++ ++
++ {% if perms.phonebox_plugin.add_voice_circuit %} ++ ++ Add ++ ++ {% endif %} ++ {% if perms.phonebox_plugin.add_voice_circuit %} ++ ++ Import ++ ++ {% endif %} ++
++ ++{% endblock %} ++ ++ ++{% block content %} ++ ++ ++ ++
++
++ ++ {# Applied filters #} ++ {% if filter_form %} ++ {% applied_filters model filter_form request.GET %} ++ {% endif %} ++ ++

{% block title %}Voice Circuits{% endblock %}

++
++
++ {% include 'phonebox_plugin/obj_table.html' with bulk_delete_url="plugins:phonebox_plugin:voice_circuit_bulk_delete" bulk_edit_url="plugins:phonebox_plugin:voice_circuit_bulk_edit" %} ++
++
++
++
++ {% include 'inc/filter_list.html' %} ++
++
++ ++{% endblock %} +--- phonebox_plugin/views.py.orig 2022-06-09 10:46:13 UTC ++++ phonebox_plugin/views.py +@@ -18,8 +18,10 @@ class NumberListView(generic.ObjectListView): + filterset = filters.NumberFilterSet + filterset_form = forms.NumberFilterForm + table = tables.NumberTable +- if NETBOX_CURRENT_VERSION >= version.parse("3.0"): ++ if NETBOX_CURRENT_VERSION >= version.parse("3.0") and NETBOX_CURRENT_VERSION < version.parse("3.4"): + template_name = "phonebox_plugin/list_view_3.x.html" ++ elif NETBOX_CURRENT_VERSION >= version.parse("3.4"): ++ template_name = "phonebox_plugin/list_view_3.4.html" + else: + template_name = "phonebox_plugin/list_view.html" + +@@ -76,8 +78,10 @@ class VoiceCircuitListView(generic.ObjectListView): + filterset = filters.VoiceCircuitFilterSet + filterset_form = forms.VoiceCircuitFilterForm + table = tables.VoiceCircuitTable +- if NETBOX_CURRENT_VERSION >= version.parse("3.0"): ++ if NETBOX_CURRENT_VERSION >= version.parse("3.0") and NETBOX_CURRENT_VERSION < version.parse("3.4"): + template_name = "phonebox_plugin/voice_circuit_list_view_3.x.html" ++ elif NETBOX_CURRENT_VERSION >= version.parse("3.4"): ++ template_name = "phonebox_plugin/voice_circuit_list_view_3.4.html" + else: + template_name = "phonebox_plugin/voice_circuit_list_view.html" +