diff --git a/.travis.yml b/.travis.yml index 7c5c131..475cb65 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,8 @@ env: matrix: - NETBOX_VER=v2.8.9 - NETBOX_VER=v2.9.11 - - NETBOX_VER=v2.10.2 + - NETBOX_VER=v2.10.10 + - NETBOX_VER=v2.11.10 # Encrypted value for PYPI_TOKEN, this secret has been generated with the following command # travis encrypt PYPI_TOKEN= --add env.global --com # Might need to update it once the repo is publish (travis-ci.org vs travis-ci.com) diff --git a/README.md b/README.md index 15adc81..e1c3681 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,12 @@ systemctl restart netbox netbox-rq ### Compatibility Matrix -| | Netbox 2.8 | Netbox 2.9 | Netbox 2.10 | -|-----------------------|------------|------------|-------------| -| Onboarding Plugin 1.3 | X | | | -| Onboarding Plugin 2.0 | X | X | | -| Onboarding Plugin 2.1 | X | X | X | +| | Netbox 2.8 | Netbox 2.9 | Netbox 2.10 | Netbox 2.11 | +|-----------------------|------------|------------|-------------|-------------| +| Onboarding Plugin 1.3 | X | | | | +| Onboarding Plugin 2.0 | X | X | | | +| Onboarding Plugin 2.1 | X | X | X | | +| Onboarding Plugin 2.2 | X | X | X | X | To ensure NetBox Onboarding plugin is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the NetBox root directory (alongside `requirements.txt`) and list the `ntc-netbox-plugin-onboarding` package: diff --git a/development/configuration.py b/development/configuration.py index 9825e21..ebfb1ba 100644 --- a/development/configuration.py +++ b/development/configuration.py @@ -9,7 +9,7 @@ NETBOX_RELEASE_CURRENT = version.parse(VERSION) NETBOX_RELEASE_28 = version.parse("2.8") NETBOX_RELEASE_29 = version.parse("2.9") -NETBOX_RELEASE_211 = version.parse("2.11") +NETBOX_RELEASE_212 = version.parse("2.12") # Enforce required configuration parameters for key in [ @@ -104,7 +104,7 @@ def is_truthy(arg): # NetBox 2.8.x Specific Settings REDIS["caching"]["DEFAULT_TIMEOUT"] = 300 REDIS["tasks"]["DEFAULT_TIMEOUT"] = 300 -elif NETBOX_RELEASE_CURRENT < NETBOX_RELEASE_211: +elif NETBOX_RELEASE_CURRENT < NETBOX_RELEASE_212: RQ_DEFAULT_TIMEOUT = 300 else: raise ImproperlyConfigured(f"Version {NETBOX_RELEASE_CURRENT} of NetBox is unsupported at this time.") @@ -248,7 +248,7 @@ def is_truthy(arg): # NetBox 2.8.x Specific Settings REMOTE_AUTH_BACKEND = "utilities.auth_backends.RemoteUserBackend" REMOTE_AUTH_DEFAULT_PERMISSIONS = [] -elif NETBOX_RELEASE_CURRENT < NETBOX_RELEASE_211: +elif NETBOX_RELEASE_CURRENT < NETBOX_RELEASE_212: REMOTE_AUTH_BACKEND = "netbox.authentication.RemoteUserBackend" REMOTE_AUTH_DEFAULT_PERMISSIONS = {} else: diff --git a/netbox_onboarding/__init__.py b/netbox_onboarding/__init__.py index ac2781c..913f6ca 100644 --- a/netbox_onboarding/__init__.py +++ b/netbox_onboarding/__init__.py @@ -12,7 +12,7 @@ limitations under the License. """ -__version__ = "2.1.0" +__version__ = "2.2.0" from extras.plugins import PluginConfig @@ -28,7 +28,7 @@ class OnboardingConfig(PluginConfig): base_url = "onboarding" required_settings = [] min_version = "2.8.1" - max_version = "2.10.99" + max_version = "2.11.99" default_settings = { "create_platform_if_missing": True, "create_manufacturer_if_missing": True, diff --git a/netbox_onboarding/filters.py b/netbox_onboarding/filters.py index f9ae743..6416893 100644 --- a/netbox_onboarding/filters.py +++ b/netbox_onboarding/filters.py @@ -16,12 +16,26 @@ from django.db.models import Q from dcim.models import Site, DeviceRole, Platform -from utilities.filters import NameSlugSearchFilterSet +from .release import NETBOX_RELEASE_CURRENT, NETBOX_RELEASE_211 from .models import OnboardingTask -class OnboardingTaskFilter(NameSlugSearchFilterSet): +if NETBOX_RELEASE_CURRENT < NETBOX_RELEASE_211: + from utilities.filters import NameSlugSearchFilterSet # pylint: disable=no-name-in-module, import-error + + class FitersetMixin(NameSlugSearchFilterSet): + """FilterSet Mixin.""" + + +else: + from netbox.filtersets import BaseFilterSet # pylint: disable=no-name-in-module, import-error + + class FitersetMixin(BaseFilterSet): + """FilterSet Mixin.""" + + +class OnboardingTaskFilter(FitersetMixin): """Filter capabilities for OnboardingTask instances.""" q = django_filters.CharFilter(method="search", label="Search",) diff --git a/netbox_onboarding/models.py b/netbox_onboarding/models.py index 5179034..090a794 100644 --- a/netbox_onboarding/models.py +++ b/netbox_onboarding/models.py @@ -17,14 +17,17 @@ from django.urls import reverse from dcim.models import Device from .choices import OnboardingStatusChoices, OnboardingFailChoices -from .release import NETBOX_RELEASE_CURRENT, NETBOX_RELEASE_29 +from .release import NETBOX_RELEASE_CURRENT, NETBOX_RELEASE_29, NETBOX_RELEASE_211 # Support NetBox 2.8 if NETBOX_RELEASE_CURRENT < NETBOX_RELEASE_29: from utilities.models import ChangeLoggedModel # pylint: disable=no-name-in-module, import-error -# Support NetBox 2.9 -else: +# Support NetBox 2.9, NetBox 2.10 +elif NETBOX_RELEASE_CURRENT < NETBOX_RELEASE_211: from extras.models import ChangeLoggedModel # pylint: disable=no-name-in-module, import-error +# Support NetBox 2.11 +else: + from netbox.models import ChangeLoggedModel # pylint: disable=no-name-in-module, import-error class OnboardingTask(ChangeLoggedModel): diff --git a/pyproject.toml b/pyproject.toml index bd17a17..3c52030 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ntc-netbox-plugin-onboarding" -version = "2.1.0" +version = "2.2.0" description = "A plugin for NetBox to easily onboard new devices." authors = ["Network to Code, LLC "] license = "Apache-2.0"