netbox-plugin-dns 0.22.8__py3-none-any.whl → 0.22.9__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
@@ -10,7 +10,7 @@ except ImportError:
10
10
  # NetBox 3.5.8
11
11
  from extras.plugins.utils import get_plugin_config
12
12
 
13
- __version__ = "0.22.8"
13
+ __version__ = "0.22.9"
14
14
 
15
15
 
16
16
  class DNSConfig(PluginConfig):
@@ -34,7 +34,7 @@ class Command(BaseCommand):
34
34
  ttl_records = (
35
35
  Record.objects.filter(ttl__isnull=False)
36
36
  .exclude(type=RecordTypeChoices.SOA)
37
- .exclude(type=RecordTypeChoices.PTR, maanged=True)
37
+ .exclude(type=RecordTypeChoices.PTR, managed=True)
38
38
  )
39
39
  for record in ttl_records:
40
40
  records = Record.objects.filter(
@@ -53,7 +53,7 @@ class NameServer(NetBoxModel):
53
53
  def get_absolute_url(self):
54
54
  return reverse("plugins:netbox_dns:nameserver", kwargs={"pk": self.pk})
55
55
 
56
- def clean(self):
56
+ def clean(self, *args, **kwargs):
57
57
  try:
58
58
  self.name = normalize_name(self.name)
59
59
  except NameFormatError as exc:
@@ -72,6 +72,8 @@ class NameServer(NetBoxModel):
72
72
  }
73
73
  ) from None
74
74
 
75
+ super().clean(*args, **kwargs)
76
+
75
77
  def save(self, *args, **kwargs):
76
78
  self.full_clean()
77
79
 
@@ -699,6 +699,8 @@ class Record(NetBoxModel):
699
699
  }
700
700
  ) from None
701
701
 
702
+ super().clean(*args, **kwargs)
703
+
702
704
  def save(
703
705
  self,
704
706
  *args,
@@ -758,7 +760,8 @@ class Record(NetBoxModel):
758
760
  class RecordIndex(SearchIndex):
759
761
  model = Record
760
762
  fields = (
761
- ("name", 100),
763
+ ("fqdn", 100),
764
+ ("name", 120),
762
765
  ("value", 150),
763
766
  ("zone", 200),
764
767
  ("type", 200),
@@ -53,7 +53,7 @@
53
53
  <td><a href="{% url 'plugins:netbox_dns:zone_records' pk=object.zone.pk %}">{{ object.zone }}</a></td>
54
54
  {% endif %}
55
55
  </tr>
56
- {% if not object.managed %}
56
+ {% if object.tenant %}
57
57
  <tr>
58
58
  <th scope="row">Tenant</th>
59
59
  <td>
@@ -41,22 +41,15 @@ class RecordView(generic.ObjectView):
41
41
  queryset = Record.objects.all().prefetch_related("zone", "ptr_record")
42
42
 
43
43
  def get_value_records(self, instance):
44
- value_fqdn = dns_name.from_text(instance.value_fqdn)
45
- value_zone_names = [
46
- value_fqdn.split(length)[1].to_text().rstrip(".")
47
- for length in range(2, len(value_fqdn) + 1)
48
- ]
49
-
50
- value_zone = (
51
- Zone.objects.filter(instance.zone.view_filter, name__in=value_zone_names)
52
- .order_by(Length("name").desc())
53
- .first()
44
+ view_filter = (
45
+ Q(zone__view__isnull=True)
46
+ if instance.zone.view is None
47
+ else Q(zone__view=instance.zone.view)
54
48
  )
55
- if not value_zone:
56
- return None
57
49
 
58
- value_name = value_fqdn.relativize(dns_name.from_text(value_zone.name))
59
- cname_targets = Record.objects.filter(zone=value_zone, name=value_name)
50
+ value_fqdn = dns_name.from_text(instance.value_fqdn)
51
+
52
+ cname_targets = Record.objects.filter(view_filter, fqdn=value_fqdn)
60
53
 
61
54
  if cname_targets:
62
55
  return RelatedRecordTable(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: netbox-plugin-dns
3
- Version: 0.22.8
3
+ Version: 0.22.9
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=ms-dOE6DcI1h8vdO1Ms_jC0aOcUxB8CfLDJsXPiFgV8,1314
1
+ netbox_dns/__init__.py,sha256=dnsGYs80wLNVaxkQOvk-C8PrRP_hsw8IWocXh3DZ-ng,1314
2
2
  netbox_dns/api/nested_serializers.py,sha256=XB7bcCjVMPYrumJWgRicj06PukQ2UCBjdr84AIUJuVQ,3291
3
3
  netbox_dns/api/serializers.py,sha256=mCH6SvluOm9g3vV_hvxtNIyqGxtPAcLEBgLu-stq6AM,8203
4
4
  netbox_dns/api/urls.py,sha256=R9VmmWtdrjvr35i5d_SfZK2lGn6JzmPuWEKTQlZ8MJo,575
@@ -31,7 +31,7 @@ netbox_dns/graphql/schema.py,sha256=D_dDusogaI55tmGx_dr1owsgzXS5fd2S-kPZ7xcXxs8,
31
31
  netbox_dns/graphql/view.py,sha256=S_61hYlQCtPQen1lI1UQs38UBWKQTaWfUxzlbpO07zA,467
32
32
  netbox_dns/graphql/zone.py,sha256=QDBxocezhLSHBGDV4RJnmarBfOsiUTeE9KzBGJ3gJi8,467
33
33
  netbox_dns/management/commands/cleanup_database.py,sha256=eggyMZrRg--cXDQJ-boofHboG1gJTs8j-oldhn6EuCo,6050
34
- netbox_dns/management/commands/cleanup_rrset_ttl.py,sha256=gCvwH6hGw32YJtcy_pEWIP29PSRMW23-qzB8SHEdixQ,2077
34
+ netbox_dns/management/commands/cleanup_rrset_ttl.py,sha256=_uEkTXCTVflRTUFW3fd6k0SsxU3sutxE9wdYZGfBFls,2077
35
35
  netbox_dns/management/commands/setup_coupling.py,sha256=Yn1nffPR7fBgB6WWBdDqdnp3k8z1QK8k6qi9xbx4U6Y,4580
36
36
  netbox_dns/management/commands/update_soa.py,sha256=qvlApMngTVpauj0CU0yeOy9r3lxxDciKorMxFsyvQhs,661
37
37
  netbox_dns/migrations/0001_initial.py,sha256=R9FbIQ7nO1ROb12NL8YQDkFQuP1r6-TtMcPwg4rwjus,4153
@@ -67,8 +67,8 @@ netbox_dns/migrations/0029_record_fqdn.py,sha256=UAAU38ekKQyiYDOJlcrz6Qbk4bqZfSH
67
67
  netbox_dns/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
68
  netbox_dns/models/__init__.py,sha256=Q7UIEe2vGh18AZN4er6CykciwXPQGgUq0L-9718wZqU,182
69
69
  netbox_dns/models/contact.py,sha256=Mzj4SR3fczOE96etWjObJElk0RVQetNuXZVtm8sS1h8,2849
70
- netbox_dns/models/nameserver.py,sha256=SjKUbMRNE3TSDzmxbKFR9b4AfYPS0UPj0QeO7XpwNRk,2941
71
- netbox_dns/models/record.py,sha256=f2NMdMVfsbjfo65uXyYzFCBGimEroLbt3AW9pkECeno,23917
70
+ netbox_dns/models/nameserver.py,sha256=d7IePSPjTUUmjWRw-giP80LN0_oPuQ5r6e58-_4Skbg,2998
71
+ netbox_dns/models/record.py,sha256=_ECe6FSr1pyaTWpBkX_JIF06d0omOsFvF31O-rh5ZX0,23980
72
72
  netbox_dns/models/registrar.py,sha256=ByKHeqH5KfswqOLjya8DZExJ1omSKFHMfCjIIYfnwTo,1416
73
73
  netbox_dns/models/view.py,sha256=ljs3Q2xQR63ZOSyja5H7DEdFbm7MX2ZjlR6uNVrAsVo,920
74
74
  netbox_dns/models/zone.py,sha256=EvNiZb0CfSg_VyjAOkKWVK-CSVDA9h_EYpt21N54C3Q,26637
@@ -87,7 +87,7 @@ netbox_dns/templates/netbox_dns/contact.html,sha256=3qHGChgLYfqUgO3_z9jQ-lFIGS0Z
87
87
  netbox_dns/templates/netbox_dns/nameserver.html,sha256=3AJVbsuhKg4Jy74rlvwrGSHd_IoDRdLT_XuK4EH3Djg,1623
88
88
  netbox_dns/templates/netbox_dns/record/managed.html,sha256=G6LPG1koUGuzUiwYdv1okdVa4sKaofiQegDBnsFL0kA,89
89
89
  netbox_dns/templates/netbox_dns/record/related.html,sha256=Aqor8uGcuHQTHjlX-Xmni2Yp4N7lOBrMOqQiszrQOC0,742
90
- netbox_dns/templates/netbox_dns/record.html,sha256=jq1kueOd5EN1myZt8RbXl4rjoTuxWezBnVv36i74QC8,5835
90
+ netbox_dns/templates/netbox_dns/record.html,sha256=qwLPb-Fis_roTkrOW8uiWKsgvr3nMAvxlLt0I-WP-ec,5830
91
91
  netbox_dns/templates/netbox_dns/registrar.html,sha256=rSShbH68nP0r8EUHn0-TZOsUj6pg7hmfvM7h2tqouUA,2130
92
92
  netbox_dns/templates/netbox_dns/related_dns_objects.html,sha256=KSzlnw1cStrJa3poKkwrt_ycIH0oH0STWIHRNy3ks4g,806
93
93
  netbox_dns/templates/netbox_dns/view.html,sha256=_lDjd2xY3upfGpNpemXXMzgsaKZlX3-PzPPAdYkIjvs,1350
@@ -107,11 +107,11 @@ netbox_dns/validators/rfc2317.py,sha256=bgqDwdqwpf5d1mt24Wrr8z8t2IYbt5RovNr6l2nv
107
107
  netbox_dns/views/__init__.py,sha256=Aw8HrCTjaJfu5JSwJsQRHfOUz4zKwAmZNByT9q6BrFU,136
108
108
  netbox_dns/views/contact.py,sha256=6-oCfK98-submcUTmi0ejw7QBscNn3S9bnS0oUTXOaY,2235
109
109
  netbox_dns/views/nameserver.py,sha256=Wa8CQ19P5uPNLMIYkj_U82wmwdp5gZoBWZnOR4ZExa0,2990
110
- netbox_dns/views/record.py,sha256=ocA-xTXAo8xWf20aG_a8NnRportID8CuWdufDIqfxyI,4904
110
+ netbox_dns/views/record.py,sha256=1-hOvEFED2ENerJ0bh0pRjUORSgj8vEaVe4ViahPqpU,4592
111
111
  netbox_dns/views/registrar.py,sha256=aznSKt1L5tILMLGgcZiBR7u7B8rNl-jM1B2-N0fTeK8,2072
112
112
  netbox_dns/views/view.py,sha256=uUvtlNEh5MYoEALvWWaCOqj_Zj8dpGOL2PUyg-UPfEA,1895
113
113
  netbox_dns/views/zone.py,sha256=SyttTAgrPPzf1jIT1B4RexCLdXYjSmPIZsefO_zog1Q,4587
114
- netbox_plugin_dns-0.22.8.dist-info/LICENSE,sha256=tziMJKpkMbySr09L6bIwsu7Ca9ICoqpMO3yAXgEMQA4,1076
115
- netbox_plugin_dns-0.22.8.dist-info/METADATA,sha256=2vxCBGxDRbpd83kCHm5eeYScmOB_sV32za7KyiV5IZw,4572
116
- netbox_plugin_dns-0.22.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
117
- netbox_plugin_dns-0.22.8.dist-info/RECORD,,
114
+ netbox_plugin_dns-0.22.9.dist-info/LICENSE,sha256=tziMJKpkMbySr09L6bIwsu7Ca9ICoqpMO3yAXgEMQA4,1076
115
+ netbox_plugin_dns-0.22.9.dist-info/METADATA,sha256=ATx4W_TxWOTtdzE3oiSorOfbYNkAWw-WQpH6fd64Qx8,4572
116
+ netbox_plugin_dns-0.22.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
117
+ netbox_plugin_dns-0.22.9.dist-info/RECORD,,