From d84a04bcc02cbfa7437b320690dd9629522d9d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AE=D0=B7=D0=B5=D1=84=D0=BE=D0=B2=D0=B8=D1=87=20=D0=9D?= =?UTF-8?q?=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9=20=D0=98=D0=B3=D0=BE=D1=80?= =?UTF-8?q?=D0=B5=D0=B2=D0=B8=D1=87?= Date: Fri, 16 Sep 2022 13:14:05 +0500 Subject: [PATCH 1/2] support for netbox 3.3 --- Makefile | 2 +- README.md | 1 + netbox_bgp/__init__.py | 2 +- netbox_bgp/api/serializers.py | 10 ++++++++-- netbox_bgp/version.py | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e1aae91..e6e9662 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PYTHON_VER?=3.8 -NETBOX_VER?=v3.2.9 +NETBOX_VER?=v3.3.3 NAME=netbox-bgp diff --git a/README.md b/README.md index 96d38ce..a384f9c 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ This plugin provide following Models: | NetBox 3.0 | 0.4.3 | | NetBox 3.1 | 0.5.0 | | NetBox 3.2 | >= 0.6.0 | +| NetBox 3.3 | >= 0.8.1 | ## Installation diff --git a/netbox_bgp/__init__.py b/netbox_bgp/__init__.py index 847c1f5..319ef50 100644 --- a/netbox_bgp/__init__.py +++ b/netbox_bgp/__init__.py @@ -12,7 +12,7 @@ class BGPConfig(PluginConfig): base_url = 'bgp' required_settings = [] min_version = '3.2.0' - max_version = '3.2.99' + max_version = '3.3.99' default_settings = { 'device_ext_page': 'right', } diff --git a/netbox_bgp/api/serializers.py b/netbox_bgp/api/serializers.py index f278349..46a01d6 100644 --- a/netbox_bgp/api/serializers.py +++ b/netbox_bgp/api/serializers.py @@ -1,7 +1,13 @@ from rest_framework.serializers import HyperlinkedIdentityField, ValidationError from rest_framework.relations import PrimaryKeyRelatedField -from netbox.api import ChoiceField, WritableNestedSerializer +# for netbox 3.3 +try: + from netbox.api import ChoiceField, WritableNestedSerializer +except ImportError: + from netbox.api.fields import ChoiceField + from netbox.api.serializers.nested import WritableNestedSerializer + from netbox.api.serializers import NetBoxModelSerializer from dcim.api.nested_serializers import NestedSiteSerializer, NestedDeviceSerializer from tenancy.api.nested_serializers import NestedTenantSerializer @@ -10,7 +16,7 @@ from netbox_bgp.models import ( BGPSession, RoutingPolicy, BGPPeerGroup, - Community, RoutingPolicyRule, PrefixList, PrefixListRule, + Community, RoutingPolicyRule, PrefixList, PrefixListRule, ) from netbox_bgp.choices import CommunityStatusChoices, SessionStatusChoices diff --git a/netbox_bgp/version.py b/netbox_bgp/version.py index 777f190..8088f75 100644 --- a/netbox_bgp/version.py +++ b/netbox_bgp/version.py @@ -1 +1 @@ -__version__ = "0.8.0" +__version__ = "0.8.1" From 34e6420b81d13a21dccdda950924d6d4600cf3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AE=D0=B7=D0=B5=D1=84=D0=BE=D0=B2=D0=B8=D1=87=20=D0=9D?= =?UTF-8?q?=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9=20=D0=98=D0=B3=D0=BE=D1=80?= =?UTF-8?q?=D0=B5=D0=B2=D0=B8=D1=87?= Date: Fri, 16 Sep 2022 13:15:04 +0500 Subject: [PATCH 2/2] readme fix; --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a384f9c..c4b66a9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This plugin provide following Models: * BGP Communities * BGP Sessions * Routing Policy -* Prefix Lists (new in 0.7.0) +* Prefix Lists ## Compatibility