From 840362de4ba8463874bd277518c8255ba5852b82 Mon Sep 17 00:00:00 2001 From: lev Date: Tue, 2 Jul 2024 13:50:32 +0200 Subject: [PATCH] compatibility changes to support Netbox 4.0 --- netbox_slm/__init__.py | 2 +- netbox_slm/navigation.py | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/netbox_slm/__init__.py b/netbox_slm/__init__.py index 127d809..fc15c18 100644 --- a/netbox_slm/__init__.py +++ b/netbox_slm/__init__.py @@ -1,4 +1,4 @@ -from extras.plugins import PluginConfig +from netbox.plugins import PluginConfig __version__ = "1.6.0" diff --git a/netbox_slm/navigation.py b/netbox_slm/navigation.py index 13b1423..07ccccc 100644 --- a/netbox_slm/navigation.py +++ b/netbox_slm/navigation.py @@ -1,5 +1,4 @@ -from extras.plugins import PluginMenuButton, PluginMenuItem -from utilities.choices import ButtonColorChoices +from netbox.plugins import PluginMenuButton, PluginMenuItem menu_items = ( PluginMenuItem( @@ -10,14 +9,12 @@ "plugins:netbox_slm:softwareproduct_add", "Add", "mdi mdi-plus-thick", - ButtonColorChoices.GREEN, permissions=["netbox_slm.add_softwareproduct"], ), PluginMenuButton( "plugins:netbox_slm:softwareproduct_import", "Import", "mdi mdi-upload", - ButtonColorChoices.CYAN, permissions=["netbox_slm.add_softwareproduct"], ), ), @@ -30,14 +27,12 @@ "plugins:netbox_slm:softwareproductversion_add", "Add", "mdi mdi-plus-thick", - ButtonColorChoices.GREEN, permissions=["netbox_slm.add_softwareproductversion"], ), PluginMenuButton( "plugins:netbox_slm:softwareproductversion_import", "Import", "mdi mdi-upload", - ButtonColorChoices.CYAN, permissions=["netbox_slm.add_softwareproductversion"], ), ), @@ -50,14 +45,12 @@ "plugins:netbox_slm:softwareproductinstallation_add", "Add", "mdi mdi-plus-thick", - ButtonColorChoices.GREEN, permissions=["netbox_slm.add_softwareproductinstallation"], ), PluginMenuButton( "plugins:netbox_slm:softwareproductinstallation_import", "Import", "mdi mdi-upload", - ButtonColorChoices.CYAN, permissions=["netbox_slm.add_softwareproductinstallation"], ), ), @@ -70,14 +63,12 @@ "plugins:netbox_slm:softwarelicense_add", "Add", "mdi mdi-plus-thick", - ButtonColorChoices.GREEN, permissions=["netbox_slm.add_softwarelicense"], ), PluginMenuButton( "plugins:netbox_slm:softwarelicense_import", "Import", "mdi mdi-upload", - ButtonColorChoices.CYAN, permissions=["netbox_slm.add_softwarelicense"], ), ),