From nobody Wed Feb 22 07:15:07 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 4PM6qb5Mzdz3sg3x; Wed, 22 Feb 2023 07:15:07 +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 4PM6qb4WWTz4BqV; Wed, 22 Feb 2023 07:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677050107; 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=2ei7QwHGeArdkunINS/AjH3ysr66yZdEx/1m2t5lzMQ=; b=T6tre24L8IHUucU44Zz1fXoVo8eUv3QKniHh5BGb1p8AqhuixJg27QTi3IisEJaQkTBAQx 2kv+I3fee/JHNR6bP6cYIzz0YAQPF9OFHRp4/FUdALKjgMi4NdvUW06JzHXW1DDMp+sJh4 tXoOuwiEc4o6ZlMIVPw/k3Ub2Ck0LfSnQw8daDlUvWniY0sBWGaOOQESTmJxMo6BVJserN E4TbaMRNcdlkuUEl6fh9UDL8isAJ4zH2kUSeXpiYxE5CYkhDDUxo9cDnGY8736BOlE29AC CO+NBxbUM7tITeE0wRMAsxTG0P0wDW3K2njbISDMxMv7IIyqJSd3r7t2VwEZSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677050107; 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=2ei7QwHGeArdkunINS/AjH3ysr66yZdEx/1m2t5lzMQ=; b=h58JD6lq1BfL80atKtAtJX038bvulD2kBX8/3qiImEF85A/05QJFqhZIBSFon9riJTBN+0 cJ8ra0NpEuFBOoTZHI8fANb2zPAVf6YQhMhaGC9wupWU3NmOzfJO6cni1NLEe308/0IYeN ghK9sUU6Z0XFKom4kTOf5b1LEHQbkp9bQgzAzL5MlbtCD1vvV8N7rZjtc1nXE7Rcn8QHIW 7RTdKpNBVhW0bt8MWTLbritD/Pcv9B53QcXM64Ufi1oaKefUErXR+v2ZNH3IaAi+Ls6nI3 b6ueVITJyK1jbwinph3HQoyhS9ZePdyy58IuNTduau0OgN/MQP1GSY2xvXFqsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677050107; a=rsa-sha256; cv=none; b=WA2GwdI/g3BVkmTo2EHy3HPW1uGcw0LXMBHzbYb3edJ6CizPzJNZ7jb78661sFP21hBMD1 GW6UykddkxWAPJzAvl241IstIPC7+I050pJJArnqh+VQ04IuBiHUWyhgO5Q93sicL+4r6W cMyWqoyj6EBtD0X0lHJSvwg0vTGo0PT+1tKX/iJvnq2l56byD+mT4XfVnQXDOGERu+dB3I LuR1XezMxFtizLl6GnX2gFMBjQLijmR63KOMKQ7Bbemsp9y3pY5g8PIzw3qFhlrmWlFIdL LrA/USvXZwTvAryCsNWKCFrPgmrglZRmxmDnjftPgqEMXcg9YJavhWUfZyHPnA== 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 4PM6qb3b59zsPf; Wed, 22 Feb 2023 07:15:07 +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 31M7F7fx099487; Wed, 22 Feb 2023 07:15:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31M7F7i8099486; Wed, 22 Feb 2023 07:15:07 GMT (envelope-from git) Date: Wed, 22 Feb 2023 07:15:07 GMT Message-Id: <202302220715.31M7F7i8099486@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Kai Knoblich Subject: git: 6f053b32fca6 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 6f053b32fca6ade8b6fb488a085e2a09cc922957 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kai: URL: https://cgit.FreeBSD.org/ports/commit/?id=6f053b32fca6ade8b6fb488a085e2a09cc922957 commit 6f053b32fca6ade8b6fb488a085e2a09cc922957 Author: Kai Knoblich AuthorDate: 2023-02-22 06:53:06 +0000 Commit: Kai Knoblich CommitDate: 2023-02-22 06:53:06 +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 --- 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 8befd177dd47..a7e22f06d40f 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= PYPI 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" +