netbox-plugin-dns 0.18.2__py3-none-any.whl → 0.18.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of netbox-plugin-dns might be problematic. Click here for more details.

netbox_dns/__init__.py CHANGED
@@ -1,12 +1,12 @@
1
1
  from extras.plugins import PluginConfig
2
2
 
3
- __version__ = "0.18.2"
3
+ __version__ = "0.18.4"
4
4
 
5
5
 
6
6
  class DNSConfig(PluginConfig):
7
7
  name = "netbox_dns"
8
- verbose_name = "Netbox DNS"
9
- description = "Netbox DNS"
8
+ verbose_name = "NetBox DNS"
9
+ description = "NetBox plugin for DNS data"
10
10
  min_version = "3.5"
11
11
  version = __version__
12
12
  author = "Peter Eckel"
@@ -27,6 +27,7 @@ class DNSConfig(PluginConfig):
27
27
  "SRV",
28
28
  ],
29
29
  "tolerate_non_rfc1035_types": [],
30
+ "enable_root_zones": False,
30
31
  }
31
32
  base_url = "netbox-dns"
32
33
 
netbox_dns/api/urls.py CHANGED
@@ -1,7 +1,7 @@
1
1
  from netbox.api.routers import NetBoxRouter
2
2
 
3
3
  from netbox_dns.api.views import (
4
- NetboxDNSRootView,
4
+ NetBoxDNSRootView,
5
5
  ViewViewSet,
6
6
  ZoneViewSet,
7
7
  NameServerViewSet,
@@ -9,7 +9,7 @@ from netbox_dns.api.views import (
9
9
  )
10
10
 
11
11
  router = NetBoxRouter()
12
- router.APIRootView = NetboxDNSRootView
12
+ router.APIRootView = NetBoxDNSRootView
13
13
 
14
14
  router.register("views", ViewViewSet)
15
15
  router.register("zones", ZoneViewSet)
netbox_dns/api/views.py CHANGED
@@ -15,13 +15,9 @@ from netbox_dns.filters import ViewFilter, ZoneFilter, NameServerFilter, RecordF
15
15
  from netbox_dns.models import View, Zone, NameServer, Record
16
16
 
17
17
 
18
- class NetboxDNSRootView(APIRootView):
19
- """
20
- NetboxDNS API root view
21
- """
22
-
18
+ class NetBoxDNSRootView(APIRootView):
23
19
  def get_view_name(self):
24
- return "NetboxDNS"
20
+ return "NetBoxDNS"
25
21
 
26
22
 
27
23
  class ViewViewSet(NetBoxModelViewSet):
netbox_dns/apps.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from django.apps import AppConfig
2
2
 
3
3
 
4
- class NetboxDnsConfig(AppConfig):
4
+ class NetBoxDNSConfig(AppConfig):
5
5
  default_auto_field = "django.db.models.BigAutoField"
6
6
  name = "netbox_dns"
netbox_dns/models.py CHANGED
@@ -289,10 +289,13 @@ class Zone(NetBoxModel):
289
289
  )
290
290
 
291
291
  def __str__(self):
292
- try:
293
- name = dns_name.from_text(self.name, origin=None).to_unicode()
294
- except dns_name.IDNAException:
295
- name = self.name
292
+ if self.name == "." and get_plugin_config("netbox_dns", "enable_root_zones"):
293
+ name = ". (root zone)"
294
+ else:
295
+ try:
296
+ name = dns_name.from_text(self.name, origin=None).to_unicode()
297
+ except dns_name.IDNAException:
298
+ name = self.name
296
299
 
297
300
  if self.view:
298
301
  return f"[{self.view}] {name}"
@@ -451,7 +454,7 @@ class Zone(NetBoxModel):
451
454
  if self.view is None:
452
455
  if (
453
456
  Zone.objects.exclude(pk=self.pk)
454
- .filter(name=self.name, view__isnull=True)
457
+ .filter(name=self.name.rstrip("."), view__isnull=True)
455
458
  .exists()
456
459
  ):
457
460
  raise ValidationError(
@@ -855,7 +858,7 @@ class Record(NetBoxModel):
855
858
  )
856
859
 
857
860
  if self.type not in get_plugin_config(
858
- "netbox_dns", "tolerate_non_rfc1035_types"
861
+ "netbox_dns", "tolerate_non_rfc1035_types", default=list()
859
862
  ):
860
863
  try:
861
864
  validate_extended_hostname(
@@ -863,7 +866,9 @@ class Record(NetBoxModel):
863
866
  (
864
867
  self.type
865
868
  in get_plugin_config(
866
- "netbox_dns", "tolerate_leading_underscore_types"
869
+ "netbox_dns",
870
+ "tolerate_leading_underscore_types",
871
+ default=list(),
867
872
  )
868
873
  ),
869
874
  )
netbox_dns/utilities.py CHANGED
@@ -4,6 +4,8 @@ from dns import name as dns_name
4
4
  from dns.exception import DNSException
5
5
  from netaddr import IPNetwork, AddrFormatError
6
6
 
7
+ from extras.plugins import get_plugin_config
8
+
7
9
 
8
10
  class NameFormatError(Exception):
9
11
  pass
@@ -38,6 +40,9 @@ def arpa_to_prefix(arpa_name):
38
40
 
39
41
 
40
42
  def name_to_unicode(name):
43
+ if name == "." and get_plugin_config("netbox_dns", "enable_root_zones"):
44
+ return "."
45
+
41
46
  try:
42
47
  return dns_name.from_text(name, origin=None).to_unicode()
43
48
  except dns_name.IDNAException:
@@ -54,6 +59,9 @@ def value_to_unicode(value):
54
59
 
55
60
 
56
61
  def normalize_name(name):
62
+ if name == "." and get_plugin_config("netbox_dns", "enable_root_zones"):
63
+ return "."
64
+
57
65
  try:
58
66
  return (
59
67
  dns_name.from_text(name, origin=dns_name.root)
netbox_dns/validators.py CHANGED
@@ -47,6 +47,9 @@ def validate_extended_hostname(name, tolerate_leading_underscores=False):
47
47
 
48
48
 
49
49
  def validate_domain_name(name):
50
+ if name == "." and get_plugin_config("netbox_dns", "enable_root_zones"):
51
+ return
52
+
50
53
  if get_plugin_config("netbox_dns", "tolerate_underscores_in_hostnames"):
51
54
  regex = rf"^{UNDERSCORE_LABEL}(\.{UNDERSCORE_LABEL})*\.?$"
52
55
  else:
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: netbox-plugin-dns
3
- Version: 0.18.2
4
- Summary: Netbox DNS is a NetBox plugin for managing DNS data.
3
+ Version: 0.18.4
4
+ Summary: NetBox DNS is a NetBox plugin for managing DNS data.
5
5
  Home-page: https://github.com/peteeckel/netbox-plugin-dns
6
6
  License: MIT
7
7
  Keywords: netbox,netbox-plugin,dns
@@ -1,10 +1,10 @@
1
- netbox_dns/__init__.py,sha256=bx3O3zilcYG8J5EfRY_2e6snjia2dJRBpHN2TrX3K-Q,903
1
+ netbox_dns/__init__.py,sha256=fp2W6Yy4ySSDgGZWGY8FV857COd3bkLwWIQayRcIe5Y,955
2
2
  netbox_dns/admin.py,sha256=LagzhiW7Dy9uFlPAbSXZWed8qBa6OvWOiHN2I7ipuTo,512
3
3
  netbox_dns/api/nested_serializers.py,sha256=NXMol8BMiMajbljFtvANZHHhQbfEQuw0YM4E2_Drrpk,1951
4
4
  netbox_dns/api/serializers.py,sha256=HCg5zC66hWOK4Z3gajO39CVAhxriEBUmRn060Fk33lw,4555
5
- netbox_dns/api/urls.py,sha256=l8B_4VJ0yj3p1yDGR27ydvzU-RGQPC6eBH7AfTkyIaw,441
6
- netbox_dns/api/views.py,sha256=-LjlqV0FoCoY7mb4mYoqnGEDbhqzTqYiWHtU9Fc-lc4,3060
7
- netbox_dns/apps.py,sha256=wEpz5pGtN2ZOC9MIhtS0kBBbCSS9gBhQSzW7BBYDqn8,151
5
+ netbox_dns/api/urls.py,sha256=ZeJtiqrxEbw5Efeb4HWpb3rp9TDTHK8hwKvquYQ7RzM,441
6
+ netbox_dns/api/views.py,sha256=RNGEpW_WhXuX-xU5FWFi41dFn-kHJTu-tqLJ-VoJN_8,3015
7
+ netbox_dns/apps.py,sha256=JCW5eS-AQBUubDJve1DjP-IRFKTFGQh1NLGWzJpC5MI,151
8
8
  netbox_dns/fields/__init__.py,sha256=KQxDL1BPIAUk5nBPtRyuZgRVHNDb8UrpG9KPIVq99VU,46
9
9
  netbox_dns/fields/address.py,sha256=hvZfYga6WrF-bi7rOl76aNAIVsdPAuIBf3b4d9-jejY,1530
10
10
  netbox_dns/fields/network.py,sha256=Pcd0kmtZI68-sVtMScpxtfUUbBuD2187JVHBQZV5TZE,3023
@@ -50,7 +50,7 @@ netbox_dns/migrations/0020_netbox_3_4.py,sha256=GwnmlYdnWgLwt2-H7hOr0Zm4-s28aDpe
50
50
  netbox_dns/migrations/0021_record_ip_address.py,sha256=Vs_0an8q0ya-JKYXjYPCut2uSUpLHIOHlqw0Y9ccp8Q,3304
51
51
  netbox_dns/migrations/0022_search.py,sha256=2S6wnH3TC2cMqCKrs0chnNnbWJDc9-MQO79kGSovoA4,891
52
52
  netbox_dns/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
- netbox_dns/models.py,sha256=i_GBGBMNU5d0oiFAJkWCXViP66bnzPkjzYMAgcAXl4o,28247
53
+ netbox_dns/models.py,sha256=zG55ZVFAhxM4jAF8shcbJmXV0LIV_ErzOmQrJV2OASs,28499
54
54
  netbox_dns/navigation.py,sha256=qwXl66Y2NKbV38ygijX9atQnHinfWbYtc1q6VaKLGP0,3158
55
55
  netbox_dns/tables/__init__.py,sha256=deqMJWAXtLukzoBMpk6DCRUK8nTuYYlVvEDYVidOa54,88
56
56
  netbox_dns/tables/nameserver.py,sha256=hkHtsrm20yAEbVh40tCETd_i_ThaRX8MSruAT6_5mcw,701
@@ -72,14 +72,14 @@ netbox_dns/templates/netbox_dns/zone.html,sha256=mKv_kyy8Mzn_pD83gUh33Zgc7pZ5LaX
72
72
  netbox_dns/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
73
73
  netbox_dns/templatetags/view_helpers.py,sha256=M7ND-gQhPTey_4wlhalthucqKJf8UjjP4LGuHMw3j-c,271
74
74
  netbox_dns/urls.py,sha256=OtgPuajiRiCgF1ho7djIXX5xp30QVMgZuMVj7VWsiW0,5202
75
- netbox_dns/utilities.py,sha256=roaawww5Py7HHgziLCWaLd4DC2LbL8s9GzM4e54aPOI,1537
76
- netbox_dns/validators.py,sha256=_zB86WjpRCTh5EjAY70xLlFQXH9jIDmUlhaBlSXTSFY,1969
75
+ netbox_dns/utilities.py,sha256=gZvzNSzXVmXRJD1IWeC-UhMFmDLQXhY2s-HZLAdmdEI,1777
76
+ netbox_dns/validators.py,sha256=JRUJUKaDIn9NFOsO3MEFDtz6_NGKOWq2QYmy0hTp0zI,2062
77
77
  netbox_dns/views/__init__.py,sha256=deqMJWAXtLukzoBMpk6DCRUK8nTuYYlVvEDYVidOa54,88
78
78
  netbox_dns/views/nameserver.py,sha256=6r6OtRstj04NLoNxidNAFJXkUlp-TIx4fHnuSp3ENag,2991
79
79
  netbox_dns/views/record.py,sha256=eT-M-rqhCrcmhpEyKOnQ8SWnxAVUgams5e86nVL9uc0,2554
80
80
  netbox_dns/views/view.py,sha256=eRFqMjPLPRjagtnPlBrw8G20MNlSykvdAhXoX1bHEFw,1895
81
81
  netbox_dns/views/zone.py,sha256=M5SXKwctdRKhdE4m7aBltfvc1ogZ7wwbW_91SYaUctw,3600
82
- netbox_plugin_dns-0.18.2.dist-info/LICENSE,sha256=tziMJKpkMbySr09L6bIwsu7Ca9ICoqpMO3yAXgEMQA4,1076
83
- netbox_plugin_dns-0.18.2.dist-info/METADATA,sha256=tQHH2aQwM2ejARNLnapAlTcz91waDbRWe6PWw_DQ500,3878
84
- netbox_plugin_dns-0.18.2.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
85
- netbox_plugin_dns-0.18.2.dist-info/RECORD,,
82
+ netbox_plugin_dns-0.18.4.dist-info/LICENSE,sha256=tziMJKpkMbySr09L6bIwsu7Ca9ICoqpMO3yAXgEMQA4,1076
83
+ netbox_plugin_dns-0.18.4.dist-info/METADATA,sha256=t7bdAx1o6px5CNutCRnKDUffMymojqHZSs7Z1VwxCGs,3878
84
+ netbox_plugin_dns-0.18.4.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
85
+ netbox_plugin_dns-0.18.4.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.5.2
2
+ Generator: poetry-core 1.6.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any