netbox-plugin-dns 0.18.3__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,6 +1,6 @@
1
1
  from extras.plugins import PluginConfig
2
2
 
3
- __version__ = "0.18.3"
3
+ __version__ = "0.18.4"
4
4
 
5
5
 
6
6
  class DNSConfig(PluginConfig):
@@ -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/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}"
@@ -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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: netbox-plugin-dns
3
- Version: 0.18.3
3
+ Version: 0.18.4
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
@@ -1,4 +1,4 @@
1
- netbox_dns/__init__.py,sha256=2N9qkc9C4RLb47jEcxJe6eQKAJsYnrEe7JzxOHOFlIY,919
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
@@ -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=bKtIQpscx4o7vxYJpQ-dIKPV2eK4KrdENXKiOZ7SZxA,28259
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.3.dist-info/LICENSE,sha256=tziMJKpkMbySr09L6bIwsu7Ca9ICoqpMO3yAXgEMQA4,1076
83
- netbox_plugin_dns-0.18.3.dist-info/METADATA,sha256=Jd20x0EomFj6qD5M4gEtEzGxYQ6igQxPE-t98XLp5fI,3878
84
- netbox_plugin_dns-0.18.3.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
85
- netbox_plugin_dns-0.18.3.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,,