Make compatible with NetBox 2.10
This commit is contained in:
parent
ad9194559f
commit
75f00bd6bb
|
@ -11,10 +11,11 @@ For now all configuration is done in the NetBox admin back-end. A later version
|
||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
||||||
This plugin in compatible with [NetBox](https://netbox.readthedocs.org/) 2.8 and later. NetBox 2.10 introduced breaking
|
This plugin in compatible with [NetBox](https://netbox.readthedocs.org/) 2.8, 2.9 and 2.10.
|
||||||
changes that make it unusable for my own use cases, so I will not be providing support for it. There is work being done
|
|
||||||
to create a fork of NetBox that is friendlier to both network operators and contributors. My future work will be in
|
NetBox 2.10 introduced breaking changes that make it unusable for my own use cases. There is work being done to create
|
||||||
support of that.
|
a fork of NetBox that is friendlier to both network operators and contributors. My future work will be in support of
|
||||||
|
that.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION = '1.0.8'
|
VERSION = '1.1.0'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from extras.plugins import PluginConfig
|
from extras.plugins import PluginConfig
|
||||||
|
@ -12,6 +12,8 @@ class NetBoxDDNSConfig(PluginConfig):
|
||||||
name = 'netbox_ddns'
|
name = 'netbox_ddns'
|
||||||
verbose_name = 'Dynamic DNS'
|
verbose_name = 'Dynamic DNS'
|
||||||
version = VERSION
|
version = VERSION
|
||||||
|
min_version = '2.8'
|
||||||
|
max_version = '2.10'
|
||||||
author = 'Sander Steffann'
|
author = 'Sander Steffann'
|
||||||
author_email = 'sander@steffann.nl'
|
author_email = 'sander@steffann.nl'
|
||||||
description = 'Dynamic DNS Connector for NetBox'
|
description = 'Dynamic DNS Connector for NetBox'
|
||||||
|
|
|
@ -12,9 +12,16 @@ from netbox_ddns.background_tasks import dns_create
|
||||||
from netbox_ddns.forms import ExtraDNSNameEditForm
|
from netbox_ddns.forms import ExtraDNSNameEditForm
|
||||||
from netbox_ddns.models import DNSStatus, ExtraDNSName
|
from netbox_ddns.models import DNSStatus, ExtraDNSName
|
||||||
from netbox_ddns.utils import normalize_fqdn
|
from netbox_ddns.utils import normalize_fqdn
|
||||||
|
|
||||||
|
try:
|
||||||
|
# NetBox <= 2.9
|
||||||
from utilities.views import ObjectDeleteView, ObjectEditView
|
from utilities.views import ObjectDeleteView, ObjectEditView
|
||||||
|
except ImportError:
|
||||||
|
# NetBox >= 2.10
|
||||||
|
from netbox.views.generic import ObjectDeleteView, ObjectEditView
|
||||||
|
|
||||||
|
|
||||||
|
# noinspection PyMethodMayBeStatic
|
||||||
class ExtraDNSNameObjectMixin:
|
class ExtraDNSNameObjectMixin:
|
||||||
def get_object(self, kwargs):
|
def get_object(self, kwargs):
|
||||||
if 'ipaddress_pk' not in kwargs:
|
if 'ipaddress_pk' not in kwargs:
|
||||||
|
@ -60,6 +67,7 @@ class ExtraDNSNameDeleteView(PermissionRequiredMixin, ExtraDNSNameObjectMixin, O
|
||||||
class IPAddressDNSNameRecreateView(PermissionRequiredMixin, View):
|
class IPAddressDNSNameRecreateView(PermissionRequiredMixin, View):
|
||||||
permission_required = 'ipam.change_ipaddress'
|
permission_required = 'ipam.change_ipaddress'
|
||||||
|
|
||||||
|
# noinspection PyMethodMayBeStatic
|
||||||
def post(self, request, ipaddress_pk):
|
def post(self, request, ipaddress_pk):
|
||||||
ip_address = get_object_or_404(IPAddress, pk=ipaddress_pk)
|
ip_address = get_object_or_404(IPAddress, pk=ipaddress_pk)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue