From 97d7cb534fa7cacc51199b346cde0371f385c104 Mon Sep 17 00:00:00 2001 From: Fabian Date: Tue, 24 Dec 2024 23:09:02 +0100 Subject: [PATCH 1/2] replace deprecated NestedPlatformSerializer I use PlatformSerializer(nested=True) instead to make the plugin compatible with netbox 4.2 which removes the deprecated NestedPlatformSerializer --- netbox_napalm_plugin/api/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox_napalm_plugin/api/serializers.py b/netbox_napalm_plugin/api/serializers.py index 443a305..ead42a7 100644 --- a/netbox_napalm_plugin/api/serializers.py +++ b/netbox_napalm_plugin/api/serializers.py @@ -1,4 +1,4 @@ -from dcim.api.nested_serializers import NestedPlatformSerializer +from dcim.api.serializers_.platforms import PlatformSerializer from netbox.api.serializers import NetBoxModelSerializer from rest_framework import serializers @@ -9,7 +9,7 @@ class NapalmPlatformConfigSerializer(NetBoxModelSerializer): url = serializers.HyperlinkedIdentityField( view_name="plugins-api:netbox_napalm_plugin-api:napalmplatformconfig-detail" ) - platform = NestedPlatformSerializer() + platform = PlatformSerializer(nested=True) class Meta: model = NapalmPlatformConfig From 668f4cf780c2c594479d2aecf25f9f1075ee4a16 Mon Sep 17 00:00:00 2001 From: Fabian Date: Tue, 24 Dec 2024 23:21:59 +0100 Subject: [PATCH 2/2] Update max_version for compatibility with netbox 4.2 make the plugin compatible with 4.2-beta1 --- netbox_napalm_plugin/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox_napalm_plugin/__init__.py b/netbox_napalm_plugin/__init__.py index bd1dc74..8b1cae4 100644 --- a/netbox_napalm_plugin/__init__.py +++ b/netbox_napalm_plugin/__init__.py @@ -22,7 +22,7 @@ class NapalmPlatformConfig(PluginConfig): 'NAPALM_ARGS': {}, } min_version = '4.0.2' - max_version = '4.1.99' + max_version = '4.2.99' config = NapalmPlatformConfig