netbox-plugin-dns 1.1b3__py3-none-any.whl → 1.1.0b5__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
@@ -5,7 +5,7 @@ from ipam.choices import IPAddressStatusChoices
5
5
 
6
6
  from netbox_dns.choices import RecordTypeChoices
7
7
 
8
- __version__ = "1.1b3"
8
+ __version__ = "1.1.0b5"
9
9
 
10
10
 
11
11
  class DNSConfig(PluginConfig):
@@ -25,13 +25,13 @@ class DNSConfig(PluginConfig):
25
25
  "zone_soa_retry": 7200,
26
26
  "zone_soa_expire": 2419200,
27
27
  "zone_soa_minimum": 3600,
28
- "autodns_disabled": False,
29
- "autodns_ipaddress_active_status": [
28
+ "dnssync_disabled": False,
29
+ "dnssync_ipaddress_active_status": [
30
30
  IPAddressStatusChoices.STATUS_ACTIVE,
31
31
  IPAddressStatusChoices.STATUS_DHCP,
32
32
  IPAddressStatusChoices.STATUS_SLAAC,
33
33
  ],
34
- "autodns_conflict_deactivate": False,
34
+ "dnssync_conflict_deactivate": False,
35
35
  "tolerate_characters_in_zone_labels": "",
36
36
  "tolerate_underscores_in_labels": False,
37
37
  "tolerate_underscores_in_hostnames": False, # Deprecated, will be removed in 1.2.0
@@ -51,8 +51,9 @@ class DNSConfig(PluginConfig):
51
51
  def ready(self):
52
52
  super().ready()
53
53
 
54
- if not settings.PLUGINS_CONFIG["netbox_dns"].get("autodns_disabled"):
55
- from netbox_dns.signals import ipam_autodns
54
+ if not settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
55
+ import netbox_dns.signals.ipam_dnssync
56
+ import netbox_dns.tables.ipam_dnssync
56
57
 
57
58
 
58
59
  #
netbox_dns/api/views.py CHANGED
@@ -4,6 +4,7 @@ from rest_framework.response import Response
4
4
  from rest_framework.routers import APIRootView
5
5
 
6
6
  from ipam.models import Prefix
7
+ from ipam.filtersets import PrefixFilterSet
7
8
 
8
9
  from netbox.api.viewsets import NetBoxModelViewSet
9
10
 
@@ -160,3 +161,4 @@ class RecordTemplateViewSet(NetBoxModelViewSet):
160
161
  class PrefixViewSet(NetBoxModelViewSet):
161
162
  queryset = Prefix.objects.all()
162
163
  serializer_class = PrefixSerializer
164
+ filterset_class = PrefixFilterSet
netbox_dns/fields/ipam.py CHANGED
@@ -6,9 +6,6 @@ __all__ = ("PrefixDynamicModelMultipleChoiceField",)
6
6
 
7
7
 
8
8
  class PrefixDynamicModelMultipleChoiceField(DynamicModelMultipleChoiceField):
9
- def __init__(self, *args, **kwargs):
10
- super().__init__(*args, **kwargs)
11
-
12
9
  widget = APISelectMultiple(api_url="/api/plugins/netbox-dns/prefixes")
13
10
 
14
11
  def label_from_instance(self, obj):
@@ -121,7 +121,7 @@ class RecordFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
121
121
  if not value.strip():
122
122
  return queryset
123
123
  qs_filter = (
124
- Q(name__icontains=value)
124
+ Q(fqdn__icontains=value)
125
125
  | Q(value__icontains=value)
126
126
  | Q(zone__name__icontains=value)
127
127
  )
netbox_dns/forms/view.py CHANGED
@@ -27,7 +27,6 @@ from netbox_dns.models import View
27
27
  from netbox_dns.fields import PrefixDynamicModelMultipleChoiceField
28
28
  from netbox_dns.utilities import (
29
29
  check_dns_records,
30
- update_dns_records,
31
30
  get_ip_addresses_by_prefix,
32
31
  get_views_by_prefix,
33
32
  )
@@ -96,7 +95,7 @@ class ViewForm(ViewPrefixUpdateMixin, TenancyForm, NetBoxModelForm):
96
95
  def __init__(self, *args, **kwargs):
97
96
  super().__init__(*args, **kwargs)
98
97
 
99
- if settings.PLUGINS_CONFIG["netbox_dns"].get("autodns_disabled"):
98
+ if settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
100
99
  del self.fields["prefixes"]
101
100
 
102
101
  if request := current_request.get():
@@ -145,7 +144,7 @@ class ViewFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
145
144
  def __init__(self, *args, **kwargs):
146
145
  super().__init__(*args, **kwargs)
147
146
 
148
- if settings.PLUGINS_CONFIG["netbox_dns"].get("autodns_disabled"):
147
+ if settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
149
148
  del self.fields["prefix_id"]
150
149
 
151
150
  model = View
@@ -181,7 +180,7 @@ class ViewImportForm(ViewPrefixUpdateMixin, NetBoxModelImportForm):
181
180
  def __init__(self, *args, **kwargs):
182
181
  super().__init__(*args, **kwargs)
183
182
 
184
- if settings.PLUGINS_CONFIG["netbox_dns"].get("autodns_disabled"):
183
+ if settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
185
184
  del self.fields["prefixes"]
186
185
 
187
186
  prefixes = CSVModelMultipleChoiceField(
netbox_dns/forms/zone.py CHANGED
@@ -81,7 +81,7 @@ class ZoneTemplateUpdateMixin:
81
81
  else:
82
82
  zone_data = self.cleaned_data.copy()
83
83
 
84
- custom_fields = dict()
84
+ custom_fields = {}
85
85
  for key, value in zone_data.copy().items():
86
86
  if key.startswith("cf_"):
87
87
  custom_fields[key[3:]] = value
@@ -105,10 +105,7 @@ class ZoneTemplateUpdateMixin:
105
105
  raise RollbackTransaction
106
106
 
107
107
  except ValidationError as exc:
108
- if isinstance(exc, dict):
109
- template_error = item.value()
110
- else:
111
- template_error = [exc]
108
+ self.add_error("template", exc.messages)
112
109
  except RollbackTransaction:
113
110
  pass
114
111
 
@@ -4,6 +4,8 @@ import strawberry
4
4
  import strawberry_django
5
5
 
6
6
  from netbox.graphql.types import NetBoxObjectType
7
+ from tenancy.graphql.types import TenantType
8
+ from ipam.graphql.types import IPAddressType, PrefixType
7
9
  from netbox.graphql.scalars import BigInt
8
10
 
9
11
  from netbox_dns.models import (
@@ -7,7 +7,7 @@ from ipam.models import IPAddress
7
7
 
8
8
 
9
9
  class Command(BaseCommand):
10
- help = "Setup IPAddress custom fields for IPAM AutoDNS"
10
+ help = "Setup IPAddress custom fields for IPAM DNSsync"
11
11
 
12
12
  def add_arguments(self, parser):
13
13
  parser.add_argument(
@@ -19,7 +19,7 @@ class Command(BaseCommand):
19
19
 
20
20
  if options.get("remove"):
21
21
  if options.get("verbosity"):
22
- self.stdout.write(f"Trying to remove IPAM AutoDNS custom fields")
22
+ self.stdout.write("Trying to remove IPAM DNSsync custom fields")
23
23
  for cf in (
24
24
  "ipaddress_dns_disabled",
25
25
  "ipaddress_dns_record_ttl",
@@ -39,7 +39,7 @@ class Command(BaseCommand):
39
39
  # Remove pre-existing IPAM Coupling custom fields
40
40
  # -
41
41
  if options.get("verbosity") >= 2:
42
- self.stdout.write(f"Trying to remove obsolete IPAM Coupling custom fields")
42
+ self.stdout.write("Trying to remove obsolete IPAM Coupling custom fields")
43
43
  for cf in (
44
44
  "ipaddress_dns_record_name",
45
45
  "ipaddress_dns_zone_id",
@@ -54,25 +54,25 @@ class Command(BaseCommand):
54
54
  pass
55
55
 
56
56
  if options.get("verbosity") >= 2:
57
- self.stdout.write(f"Creating IPAM AutoDNS custom fields")
57
+ self.stdout.write("Creating IPAM DNSsync custom fields")
58
58
 
59
59
  if not CustomField.objects.filter(
60
60
  name="ipaddress_dns_disabled",
61
61
  type=CustomFieldTypeChoices.TYPE_BOOLEAN,
62
62
  object_types=ipaddress_object_type,
63
63
  ).exists():
64
- cf_autodns_disabled = CustomField.objects.create(
64
+ cf_dnssync_disabled = CustomField.objects.create(
65
65
  name="ipaddress_dns_disabled",
66
- label="Disable AutoDNS",
66
+ label="Disable DNSsync",
67
67
  description="Disable DNS address and pointer record generation for this address",
68
68
  type=CustomFieldTypeChoices.TYPE_BOOLEAN,
69
69
  required=False,
70
70
  default=False,
71
- group_name="AutoDNS",
71
+ group_name="DNSsync",
72
72
  is_cloneable=True,
73
73
  weight=100,
74
74
  )
75
- cf_autodns_disabled.object_types.set([ipaddress_object_type])
75
+ cf_dnssync_disabled.object_types.set([ipaddress_object_type])
76
76
  if options.get("verbosity"):
77
77
  self.stdout.write("Created custom field 'ipaddress_dns_disabled'")
78
78
 
@@ -82,8 +82,8 @@ class Command(BaseCommand):
82
82
  type=CustomFieldTypeChoices.TYPE_INTEGER,
83
83
  object_types=ipaddress_object_type,
84
84
  )
85
- if cf_ttl.group_name != "AutoDNS":
86
- cf_ttl.group_name = "AutoDNS"
85
+ if cf_ttl.group_name != "DNSsync":
86
+ cf_ttl.group_name = "DNSsync"
87
87
  cf_ttl.description = ("TTL for DNS records created for this address",)
88
88
  cf_ttl.save()
89
89
  if options.get("verbosity"):
@@ -97,7 +97,7 @@ class Command(BaseCommand):
97
97
  validation_minimum=0,
98
98
  validation_maximum=2147483647,
99
99
  required=False,
100
- group_name="AutoDNS",
100
+ group_name="DNSsync",
101
101
  is_cloneable=True,
102
102
  weight=200,
103
103
  )
@@ -111,8 +111,8 @@ class Command(BaseCommand):
111
111
  type=CustomFieldTypeChoices.TYPE_BOOLEAN,
112
112
  object_types=ipaddress_object_type,
113
113
  )
114
- if cf_disable_ptr.group_name != "AutoDNS":
115
- cf_disable_ptr.group_name = "AutoDNS"
114
+ if cf_disable_ptr.group_name != "DNSsync":
115
+ cf_disable_ptr.group_name = "DNSsync"
116
116
  cf_disable_ptr.description = (
117
117
  "Disable DNS PTR record generation for this address",
118
118
  )
@@ -129,7 +129,7 @@ class Command(BaseCommand):
129
129
  type=CustomFieldTypeChoices.TYPE_BOOLEAN,
130
130
  required=False,
131
131
  default=False,
132
- group_name="AutoDNS",
132
+ group_name="DNSsync",
133
133
  is_cloneable=True,
134
134
  weight=300,
135
135
  )
@@ -58,7 +58,7 @@ def record_data_from_ip_address(ip_address, zone):
58
58
  RecordStatusChoices.STATUS_ACTIVE
59
59
  if ip_address.status
60
60
  in settings.PLUGINS_CONFIG["netbox_dns"].get(
61
- "autodns_ipaddress_active_status", []
61
+ "dnssync_ipaddress_active_status", []
62
62
  )
63
63
  else RecordStatusChoices.STATUS_INACTIVE
64
64
  ),
@@ -576,7 +576,7 @@ class Record(ObjectModificationMixin, NetBoxModel):
576
576
  if not records.filter(
577
577
  ipam_ip_address__isnull=True
578
578
  ).exists() or get_plugin_config(
579
- "netbox_dns", "autodns_conflict_deactivate", False
579
+ "netbox_dns", "dnssync_conflict_deactivate", False
580
580
  ):
581
581
  return
582
582
 
@@ -590,7 +590,7 @@ class Record(ObjectModificationMixin, NetBoxModel):
590
590
  if self.ipam_ip_address is None or not self.is_active:
591
591
  return
592
592
 
593
- if not get_plugin_config("netbox_dns", "autodns_conflict_deactivate", False):
593
+ if not get_plugin_config("netbox_dns", "dnssync_conflict_deactivate", False):
594
594
  return
595
595
 
596
596
  records = Record.objects.filter(
@@ -633,7 +633,7 @@ class Record(ObjectModificationMixin, NetBoxModel):
633
633
  if not records.exists():
634
634
  return
635
635
 
636
- conflicting_ttls = ", ".join(set(str(record.ttl) for record in records))
636
+ conflicting_ttls = ", ".join({str(record.ttl) for record in records})
637
637
  raise ValidationError(
638
638
  {
639
639
  "ttl": f"There is at least one active {self.type} record for name {self.name} in zone {self.zone} and TTL is different ({conflicting_ttls})."
@@ -18,23 +18,22 @@ from netbox_dns.utilities import (
18
18
  delete_dns_records,
19
19
  get_views_by_prefix,
20
20
  get_ip_addresses_by_prefix,
21
- get_ip_addresses_by_view,
22
21
  )
23
22
 
24
- AUTODNS_CUSTOM_FIELDS = {
23
+ DNSSYNC_CUSTOM_FIELDS = {
25
24
  "ipaddress_dns_disabled": False,
26
25
  "ipaddress_dns_record_ttl": None,
27
26
  "ipaddress_dns_record_disable_ptr": False,
28
27
  }
29
28
 
30
29
  IPADDRESS_ACTIVE_STATUS = settings.PLUGINS_CONFIG["netbox_dns"][
31
- "autodns_ipaddress_active_status"
30
+ "dnssync_ipaddress_active_status"
32
31
  ]
33
32
  ENFORCE_UNIQUE_RECORDS = settings.PLUGINS_CONFIG["netbox_dns"]["enforce_unique_records"]
34
33
 
35
34
 
36
35
  @receiver(post_clean, sender=IPAddress)
37
- def ipam_autodns_ipaddress_post_clean(instance, **kwargs):
36
+ def ipam_dnssync_ipaddress_post_clean(instance, **kwargs):
38
37
  if not isinstance(instance.address, IPNetwork):
39
38
  return
40
39
 
@@ -82,7 +81,7 @@ def ipam_autodns_ipaddress_post_clean(instance, **kwargs):
82
81
  != IPAddress.objects.get(pk=instance.pk).custom_field_data.get(
83
82
  cf, cf_default
84
83
  )
85
- for cf, cf_default in AUTODNS_CUSTOM_FIELDS.items()
84
+ for cf, cf_default in DNSSYNC_CUSTOM_FIELDS.items()
86
85
  )
87
86
  )
88
87
  and not check_record_permission()
@@ -91,13 +90,13 @@ def ipam_autodns_ipaddress_post_clean(instance, **kwargs):
91
90
  and any(
92
91
  (
93
92
  cf_data.get(cf, cf_default) != cf_default
94
- for cf, cf_default in AUTODNS_CUSTOM_FIELDS.items()
93
+ for cf, cf_default in DNSSYNC_CUSTOM_FIELDS.items()
95
94
  )
96
95
  )
97
96
  and not check_record_permission(change=False, delete=False)
98
97
  ):
99
98
  raise ValidationError(
100
- f"User '{request.user}' is not allowed to alter AutoDNS custom fields"
99
+ f"User '{request.user}' is not allowed to alter DNSsync custom fields"
101
100
  )
102
101
 
103
102
  try:
@@ -107,22 +106,22 @@ def ipam_autodns_ipaddress_post_clean(instance, **kwargs):
107
106
 
108
107
 
109
108
  @receiver(pre_delete, sender=IPAddress)
110
- def ipam_autodns_ipaddress_pre_delete(instance, **kwargs):
109
+ def ipam_dnssync_ipaddress_pre_delete(instance, **kwargs):
111
110
  delete_dns_records(instance)
112
111
 
113
112
 
114
113
  @receiver(pre_save, sender=IPAddress)
115
- def ipam_autodns_ipaddress_pre_save(instance, **kwargs):
114
+ def ipam_dnssync_ipaddress_pre_save(instance, **kwargs):
116
115
  check_dns_records(instance)
117
116
 
118
117
 
119
118
  @receiver(post_save, sender=IPAddress)
120
- def ipam_autodns_ipaddress_post_save(instance, **kwargs):
119
+ def ipam_dnssync_ipaddress_post_save(instance, **kwargs):
121
120
  update_dns_records(instance)
122
121
 
123
122
 
124
123
  @receiver(pre_save, sender=Prefix)
125
- def ipam_autodns_prefix_pre_save(instance, **kwargs):
124
+ def ipam_dnssync_prefix_pre_save(instance, **kwargs):
126
125
  """
127
126
  Changes that modify the prefix hierarchy cannot be validated properly before
128
127
  commiting them. So the solution in this case is to ask the user to deassign
@@ -151,7 +150,7 @@ def ipam_autodns_prefix_pre_save(instance, **kwargs):
151
150
 
152
151
 
153
152
  @receiver(pre_delete, sender=Prefix)
154
- def ipam_autodns_prefix_pre_delete(instance, **kwargs):
153
+ def ipam_dnssync_prefix_pre_delete(instance, **kwargs):
155
154
  parent = instance.get_parents().last()
156
155
  request = current_request.get()
157
156
 
@@ -195,7 +194,7 @@ def ipam_autodns_prefix_pre_delete(instance, **kwargs):
195
194
 
196
195
 
197
196
  @receiver(m2m_changed, sender=_view.View.prefixes.through)
198
- def ipam_autodns_view_prefix_changed(**kwargs):
197
+ def ipam_dnssync_view_prefix_changed(**kwargs):
199
198
  action = kwargs.get("action")
200
199
  request = current_request.get()
201
200
 
@@ -0,0 +1,11 @@
1
+ import django_tables2 as tables
2
+
3
+ from ipam.tables import PrefixTable
4
+ from utilities.tables import register_table_column
5
+
6
+ views = tables.ManyToManyColumn(
7
+ verbose_name="DNS Views",
8
+ linkify_item=True,
9
+ )
10
+
11
+ register_table_column(views, "netbox_dns_views", PrefixTable)
@@ -1,4 +1,7 @@
1
1
  import django_tables2 as tables
2
+ from django_tables2.utils import Accessor
3
+ from django.utils.html import format_html
4
+
2
5
 
3
6
  from netbox.tables import (
4
7
  NetBoxTable,
@@ -6,11 +9,16 @@ from netbox.tables import (
6
9
  TagColumn,
7
10
  ActionsColumn,
8
11
  )
12
+ from ipam.lookups import Host, Inet
9
13
  from tenancy.tables import TenancyColumnsMixin
10
14
 
11
15
  from netbox_dns.models import Record
12
16
  from netbox_dns.utilities import value_to_unicode
13
17
 
18
+ import logging
19
+
20
+ logger = logging.getLogger("netbox_dns")
21
+
14
22
 
15
23
  __all__ = (
16
24
  "RecordTable",
@@ -100,6 +108,11 @@ class ManagedRecordTable(RecordBaseTable):
100
108
  verbose_name="IPAM IP Address",
101
109
  linkify=True,
102
110
  )
111
+ related_ip_address = tables.Column(
112
+ verbose_name="Related IP Address",
113
+ empty_values=(),
114
+ orderable=False,
115
+ )
103
116
  actions = ActionsColumn(actions=("changelog",))
104
117
 
105
118
  class Meta(NetBoxTable.Meta):
@@ -113,6 +126,7 @@ class ManagedRecordTable(RecordBaseTable):
113
126
  "unicode_value",
114
127
  "address_record",
115
128
  "ipam_ip_address",
129
+ "related_ip_address",
116
130
  "active",
117
131
  )
118
132
  default_columns = (
@@ -124,6 +138,28 @@ class ManagedRecordTable(RecordBaseTable):
124
138
  "active",
125
139
  )
126
140
 
141
+ def render_related_ip_address(self, record):
142
+ if record.ipam_ip_address is not None:
143
+ address = record.ipam_ip_address
144
+ elif (
145
+ hasattr(record, "address_record")
146
+ and record.address_record.ipam_ip_address is not None
147
+ ):
148
+ address = record.address_record.ipam_ip_address
149
+ else:
150
+ return format_html("—")
151
+
152
+ return format_html(f"<a href='{address.get_absolute_url()}'>{address}</a>")
153
+
154
+ def value_related_ip_address(self, record):
155
+ if record.ipam_ip_address is not None:
156
+ return record.ipam_ip_address
157
+ elif (
158
+ hasattr(record, "address_record")
159
+ and record.address_record.ipam_ip_address is not None
160
+ ):
161
+ return record.address_record.ipam_ip_address
162
+
127
163
 
128
164
  class RelatedRecordTable(RecordBaseTable):
129
165
  actions = ActionsColumn(actions=())
@@ -4,7 +4,7 @@ from django.urls import reverse
4
4
  from netbox.plugins.utils import get_plugin_config
5
5
  from netbox.plugins import PluginTemplateExtension
6
6
 
7
- from netbox_dns.models import Record, Zone, View, NameServer
7
+ from netbox_dns.models import Record
8
8
  from netbox_dns.choices import RecordTypeChoices
9
9
  from netbox_dns.tables import RelatedRecordTable, RelatedViewTable
10
10
  from netbox_dns.utilities import get_views_by_prefix
@@ -114,7 +114,7 @@ class IPRelatedDNSRecords(PluginTemplateExtension):
114
114
  )
115
115
 
116
116
 
117
- if not settings.PLUGINS_CONFIG["netbox_dns"].get("autodns_disabled"):
117
+ if not settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
118
118
  template_extensions = [RelatedDNSRecords, RelatedDNSViews]
119
119
  else:
120
120
  template_extensions = []
@@ -35,7 +35,7 @@
35
35
  </div>
36
36
  <div class="col col-md-6">
37
37
  {% include 'inc/panels/tags.html' %}
38
- {% if not settings.PLUGINS_CONFIG.netbox_dns.autodns_disabled %}
38
+ {% if not settings.PLUGINS_CONFIG.netbox_dns.dnssync_disabled %}
39
39
  <div class="card">
40
40
  <h5 class="card-header">
41
41
  IPAM Prefixes
@@ -1,2 +1,2 @@
1
1
  from .conversions import *
2
- from .ipam_autodns import *
2
+ from .ipam_dnssync import *
@@ -13,6 +13,7 @@ from ipam.models import IPAddress, Prefix
13
13
  from netbox_dns.models import zone as _zone
14
14
  from netbox_dns.models import record as _record
15
15
  from netbox_dns.models import view as _view
16
+ from netbox_dns.choices import RecordStatusChoices
16
17
 
17
18
 
18
19
  __all__ = (
@@ -46,7 +47,7 @@ def _get_record_status(ip_address):
46
47
  RecordStatusChoices.STATE_ACTIVE
47
48
  if ip_address.status
48
49
  in settings.PLUGINS_CONFIG["netbox_dns"].get(
49
- "autodns_ipaddress_active_status", []
50
+ "dnssync_ipaddress_active_status", []
50
51
  )
51
52
  else RecordStatusChoices.STATUS_INACTIVE
52
53
  )
@@ -1,6 +1,10 @@
1
1
  from dns import name as dns_name
2
2
 
3
+ from django.db.models import F, Q, Case, When, OuterRef, Subquery
4
+
3
5
  from netbox.views import generic
6
+ from ipam.fields import IPAddressField
7
+ from ipam.models import IPAddress
4
8
 
5
9
  from netbox_dns.filtersets import RecordFilterSet
6
10
  from netbox_dns.forms import (
@@ -37,9 +41,7 @@ class RecordListView(generic.ObjectListView):
37
41
 
38
42
 
39
43
  class ManagedRecordListView(generic.ObjectListView):
40
- queryset = Record.objects.filter(managed=True).prefetch_related(
41
- "zone", "address_record"
42
- )
44
+ queryset = Record.objects.prefetch_related("ipam_ip_address", "address_record")
43
45
  filterset = RecordFilterSet
44
46
  filterset_form = RecordFilterForm
45
47
  table = ManagedRecordTable
@@ -90,11 +92,11 @@ class RecordView(generic.ObjectView):
90
92
  zone=parent_zone,
91
93
  )
92
94
  cname_records = cname_records.union(
93
- set(
95
+ {
94
96
  record
95
97
  for record in parent_cname_records
96
98
  if record.value_fqdn == instance.fqdn
97
- )
99
+ }
98
100
  )
99
101
 
100
102
  if cname_records:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: netbox-plugin-dns
3
- Version: 1.1b3
3
+ Version: 1.1.0b5
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=Ck45UmyPbGnlkricEwMjOpBDT-BBjVBZfmKi3AbwsxM,1833
1
+ netbox_dns/__init__.py,sha256=27jTa_Vkm837fJbzvwAxS3hYrI6ZzPDeczbquH4PEfg,1880
2
2
  netbox_dns/api/nested_serializers.py,sha256=-ZhAiyf-8UHlkcBomBp1J7ci1dSwrxWRbbfskD-D_yQ,3172
3
3
  netbox_dns/api/serializers.py,sha256=u-kQurUftGkUGAMh-VkMgXPebLYeZq9WDz9uKzkk2No,370
4
4
  netbox_dns/api/serializers_/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -12,20 +12,20 @@ netbox_dns/api/serializers_/view.py,sha256=u5HqZtPzGCBTFCsH5GkPGsyG-oR4WIJ8XOqdW
12
12
  netbox_dns/api/serializers_/zone.py,sha256=ZOCNHNufPK8T9UKKjT4NcIyfb1zwG7gD6TpPTlMHi0k,4862
13
13
  netbox_dns/api/serializers_/zone_template.py,sha256=usx0vRsqRqHP6sqB92fQy3VTjIfjYflULTtQhQksSpk,3709
14
14
  netbox_dns/api/urls.py,sha256=f77mwzenQ54WMZeLRLKBmPZMKmfXhagREe7LAuSjAsM,802
15
- netbox_dns/api/views.py,sha256=lCK_Z1sImxGc-ClfEsZzh-HoksaLAb6fBgb6dj9lk8o,4805
15
+ netbox_dns/api/views.py,sha256=kr_cXu-4sL6VaXzJqSJN0ajqetvuHrpdb0GONtTijkM,4887
16
16
  netbox_dns/apps.py,sha256=JCW5eS-AQBUubDJve1DjP-IRFKTFGQh1NLGWzJpC5MI,151
17
17
  netbox_dns/choices/__init__.py,sha256=jOVs2VGV5SVADRlqVnrFeAy26i8BIeEAbGpiX7K8bL8,42
18
18
  netbox_dns/choices/record.py,sha256=IYW_g1ZvuNX2ZlRLOkurcrdfWgcXNpi2gQzRfX5C0lY,1113
19
19
  netbox_dns/choices/zone.py,sha256=u0zt03gTkeo_und0VxaTTCh3GIFv6UxtUIhoe3VJ00A,472
20
20
  netbox_dns/fields/__init__.py,sha256=U1nbFIwwtvr10pp3Sk91jEZeWkVQBSJtr0BVWYgOfiA,89
21
21
  netbox_dns/fields/address.py,sha256=DJwc-z5Lg6US85gNIB_Chx7ahs1GYNswdhaXkLiK3jA,1554
22
- netbox_dns/fields/ipam.py,sha256=nj3nNMU4ebo3Ung0M7uhOBLlKUGDPIVTv1lJJ82HcLU,565
22
+ netbox_dns/fields/ipam.py,sha256=wla-kBm77BpD0LNQhgRZS1RYbVois7WDqPpyQkUT02k,481
23
23
  netbox_dns/fields/network.py,sha256=FgKEm5DAe_4D7Fubtj8B4SwfU3-Z9KV7kDIzRNpBBnQ,3682
24
24
  netbox_dns/fields/rfc2317.py,sha256=24qNNLbI-SGlsKqGaLNaVk8EHFrju65YTET3O-8XgTc,2571
25
25
  netbox_dns/filtersets/__init__.py,sha256=zvHYWy23FFmK4vxLpoMo-OD5OQBtcTUV_HG-5LCtvQE,197
26
26
  netbox_dns/filtersets/contact.py,sha256=VnlNX6dyUlEbj7tz9cgRKSWQOdg7OqP32cD2IyD5hu8,1091
27
27
  netbox_dns/filtersets/nameserver.py,sha256=I7RoIUcgXyIoMrhuS0dJr8uPi0AdNj6D3G6t2oSiQ7s,1147
28
- netbox_dns/filtersets/record.py,sha256=nr-oLCnaceiQua5tL-_teYj54X-VMXQeYihbCjykaJY,3750
28
+ netbox_dns/filtersets/record.py,sha256=Jt3RlI4MIfeY5xYkLse1y1rzmKCdmuk-CRAxxaNVYbY,3750
29
29
  netbox_dns/filtersets/record_template.py,sha256=jGSjGFEnNSoxtUd7diV8wEhw8qZclz2dKLSqyVC7Djo,1548
30
30
  netbox_dns/filtersets/registrar.py,sha256=Wh_l-IXRHnJhW7Pyokp3czQZISDKzXnWeSQKp512Drc,977
31
31
  netbox_dns/filtersets/view.py,sha256=sGUhmyr66GY2CVXOFX2g5evDt0nbU6XPPCwptvnicHQ,993
@@ -37,16 +37,16 @@ netbox_dns/forms/nameserver.py,sha256=LHomCHmFcASobaD3Z7yhAyA24h-LrYImVMz-EUXbwK
37
37
  netbox_dns/forms/record.py,sha256=svBVAFy-egDEPLcRWkxNi_1bkabKmWgJ87pmdNt6dh4,7155
38
38
  netbox_dns/forms/record_template.py,sha256=Q77p9sExJ8Xbl-Co2Px2R0At5O3naQJwx4pnino6i2o,5573
39
39
  netbox_dns/forms/registrar.py,sha256=FMnvrcq62R3wNp_2ZUEk3v_PIav0KrWPATaJ7_9KFAo,3758
40
- netbox_dns/forms/view.py,sha256=AMTBIw8uNTjDdq8QZTxyw-e8KfQ43SVkO2tc3og4vt8,9069
41
- netbox_dns/forms/zone.py,sha256=17Ii2csnYquuz7HGgaK36ZgOzWnFXFeh1IQYvWnBKC0,23537
40
+ netbox_dns/forms/view.py,sha256=DkfZOLkCClTF-7pLMiZE8J1Z9_oxmeBiEWZ7-_yTZro,9045
41
+ netbox_dns/forms/zone.py,sha256=-ww_4nepCwVnsCsJdowtzz2HPmKLqNVedHUi5QC8uoM,23445
42
42
  netbox_dns/forms/zone_template.py,sha256=UNykid5pRB_ydy40j2DzRlBXp3_QAOqdqxdUojKYTd4,8161
43
43
  netbox_dns/graphql/__init__.py,sha256=ZZSsx-VM108tB_FrcVy3uGGhtmePpkXnY5U1ytnoTvE,490
44
44
  netbox_dns/graphql/filters.py,sha256=6Ot_d1e7h5lVXVVBB3hyWUql94K3zsK9Tjb3RVJqluw,1706
45
45
  netbox_dns/graphql/schema.py,sha256=P-oQ8ei3sC6XLhgCa_riRbRTrMkPCVTJXkGv0U2rPYw,2682
46
- netbox_dns/graphql/types.py,sha256=4ewWOqEbWtCBiU9bdIm_6CIm6MKAM6szCAXSvokpqWg,6108
46
+ netbox_dns/graphql/types.py,sha256=Obr9JDsMJlMaJLKbTau7prZUYI6pQj6aIpT-nT4JnZs,6210
47
47
  netbox_dns/management/commands/cleanup_database.py,sha256=kfnyybudwKGigjJmrOwafPWSUasZr9jQsxN4eWAgMvY,5969
48
48
  netbox_dns/management/commands/cleanup_rrset_ttl.py,sha256=UFRURLBcFeGHUS2lrYFv7UWIebjI72aG1EUQJt0XsXw,2046
49
- netbox_dns/management/commands/setup_autodns.py,sha256=8ipEDyvZ0MIzkcj9gASModRbPHKyKCnyfke2SYOl61g,5733
49
+ netbox_dns/management/commands/setup_dnssync.py,sha256=qtVj6egSjclaQbuI60hLfl-zg89VJVbX-TB17f1k77Y,5730
50
50
  netbox_dns/management/commands/update_soa.py,sha256=Rj_Xk-qpwkAVRubVnM5OqSTwgzi93E0PqjwGb3rYjf0,660
51
51
  netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py,sha256=3U0810NWSHPu2dTSHpfzlleDgwMS04FhJ_CkO76SDaw,10283
52
52
  netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py,sha256=ML6Hp17lrXiaG0eUlBjKMm6HUNhw0AHPnKrb9AN-F6E,20279
@@ -72,7 +72,7 @@ netbox_dns/mixins/object_modification.py,sha256=JbGi8a52wkZ3fFBlfat590CfqRJcEWxB
72
72
  netbox_dns/models/__init__.py,sha256=wjwNsRttUVYQHZODZi806a_iUDoq_o7mdKObqh1N7N4,300
73
73
  netbox_dns/models/contact.py,sha256=oNLyD_6TOTNQQTcCvv6TAC7OkzPTMIRy2NP5nwNKaNg,3009
74
74
  netbox_dns/models/nameserver.py,sha256=yKo4Fwqnv5VtTndU2px7tRS3voF3Cal7OWQ6AImLwl0,3208
75
- netbox_dns/models/record.py,sha256=ArQp7gB94FZH9MeihfIbx9pN3Y90gSj4VsoSF6y1348,25966
75
+ netbox_dns/models/record.py,sha256=LgJJvL85hKrN9a3fpq90k9oit8oqNvzwbrA-MVve8DE,25963
76
76
  netbox_dns/models/record_template.py,sha256=3t9VceviX3kNIo5o0VPVFupLFDqPxpHIVLp5U3pBKB4,4661
77
77
  netbox_dns/models/registrar.py,sha256=T_oMUlTWTDixOVlIbEZGvOBdvUrKxRkkS41xgM2Oee8,1557
78
78
  netbox_dns/models/view.py,sha256=SYmhNYyRCv0rSCK5jrHtug4QgfWCBbjsAjZEEHk02QU,2873
@@ -80,17 +80,18 @@ netbox_dns/models/zone.py,sha256=C1f6uGKGeD_FKtFhWXiUO7gKF19pzu-9-pj0txP8R1E,290
80
80
  netbox_dns/models/zone_template.py,sha256=lkiSIfx8KM0Cs3Mb3dLBxKbSpcssVUzQiSmD5W46was,3753
81
81
  netbox_dns/navigation.py,sha256=EITDZkbpu4KCC9u4Noj7OORWnkL3EYT2RIRvYlTw34Q,5961
82
82
  netbox_dns/signals/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
83
- netbox_dns/signals/ipam_autodns.py,sha256=XkngO_hbfi_kzb7pnplQbOYp8TcUvpP1j3R49rWy7Go,7908
83
+ netbox_dns/signals/ipam_dnssync.py,sha256=uGK8R_pEKZJ4STTYgw2y5j0g6T0pQZbI9HZLmtfdOwM,7878
84
84
  netbox_dns/tables/__init__.py,sha256=s41w4o77tIwmhnLjsOsg08R9m3wrlomkkfCLTVQuPzc,196
85
85
  netbox_dns/tables/contact.py,sha256=sPs7d1ZhVC5dOS37dPYFqebNd7WGvsV_eYzX_TMcbzY,804
86
+ netbox_dns/tables/ipam_dnssync.py,sha256=7gxf6nXn2zgpnpCr5E5qebXv7QCzrgIqfSzyka53USU,272
86
87
  netbox_dns/tables/nameserver.py,sha256=fFiE-yH-_GyRDaV4SVw094r6uH58Kx56NSWDGaMR58g,764
87
- netbox_dns/tables/record.py,sha256=0Yg0qwZ8Vjz6pkZnmof4ZK1Hsvk9DNEzmJwoIwJZJFQ,3189
88
+ netbox_dns/tables/record.py,sha256=X2DZVeQtgSdXaHWS1G9SI7ue462CVV6PJd6EoUXXNsQ,4355
88
89
  netbox_dns/tables/record_template.py,sha256=16Lu-WDjs2m9Uxx6WkURL39NlyJ8lWzj5Kl6C6lz3E8,2159
89
90
  netbox_dns/tables/registrar.py,sha256=M-ckyQUs6dqjTCPf7bAr6UuLEA-q9f9CxKW7yp3rGoM,680
90
91
  netbox_dns/tables/view.py,sha256=jf2S4TiOdMq6-wWk0ndR1uBJpkOx_f3pqAuM1nSXTBo,1178
91
92
  netbox_dns/tables/zone.py,sha256=IeCiflrQBn1INV_PxoTySWQrDalykY4mDSG76VXC5WM,1877
92
93
  netbox_dns/tables/zone_template.py,sha256=70hvS-xpeaLkcM6y0R9xsUMQVKgTgZJaWWNd99BfmzI,1479
93
- netbox_dns/template_content.py,sha256=a2TAwrw0TeDICv8vSiAuzeeuBEqPbahm_OfFkYGrG-s,3742
94
+ netbox_dns/template_content.py,sha256=YzE-ZJlERhFybrUKJrmNwHk8_8RPNexkV66x62Sbzic,3718
94
95
  netbox_dns/templates/netbox_dns/contact.html,sha256=fMHAQyLXIxohKoCTxFEnKetl9UVXeQgjasfpv_JONaw,2855
95
96
  netbox_dns/templates/netbox_dns/nameserver.html,sha256=DpTdetQVV_jKThDbi62LvbhiCay-1QxR-yiJEiPFm4w,1554
96
97
  netbox_dns/templates/netbox_dns/record/managed.html,sha256=G6LPG1koUGuzUiwYdv1okdVa4sKaofiQegDBnsFL0kA,89
@@ -101,7 +102,7 @@ netbox_dns/templates/netbox_dns/registrar.html,sha256=O5veGmW59Pf5yN25ihPLvRIkA2
101
102
  netbox_dns/templates/netbox_dns/view/button.html,sha256=oXKNyPtY8XIu2sxtZWpFRXKXv862407ESyUQ4YsWCGE,292
102
103
  netbox_dns/templates/netbox_dns/view/prefix.html,sha256=HD8f4mnbzFOXDj3Y_yq8yEeDpz_yFud8ZMpqbxzCEnA,1445
103
104
  netbox_dns/templates/netbox_dns/view/related.html,sha256=W9Ie2aOsFkWyYtBnZn38seQDBmyJkV9dqFDG-Dq3yMk,736
104
- netbox_dns/templates/netbox_dns/view.html,sha256=NSEfPSHPLw5yjUSat9N_KYKF5FezmTlCXqPC6FYiK9E,2479
105
+ netbox_dns/templates/netbox_dns/view.html,sha256=zqf42FGdNudoIIWCaCe9bmP_VOZDbv3GjS-qJNMKPVY,2479
105
106
  netbox_dns/templates/netbox_dns/zone/base.html,sha256=n_E4aVYdGeZZl-ARE8sb4DgAAgPs92X1UEFepX3xIlM,495
106
107
  netbox_dns/templates/netbox_dns/zone/child.html,sha256=kH56PJFBGCjiRdIh7zCtClnZdfOChqN_sYslsyoz5gU,2147
107
108
  netbox_dns/templates/netbox_dns/zone/child_zone.html,sha256=b9CSGWEfWT7hLQ80gApMnu7mXM8w2LT-3UaOYe6HIRQ,510
@@ -120,9 +121,9 @@ netbox_dns/urls/registrar.py,sha256=u6B0zGGYNUJIKTo9uGiUeZLPD0QMGaQOAPShGEy4NaA,
120
121
  netbox_dns/urls/view.py,sha256=jz5ANOOLCMAcWermTZYGq9BvnP02jpKGL6hCm33C47Q,1478
121
122
  netbox_dns/urls/zone.py,sha256=rmB1BkzmWNG06ILUf-39Aj6-SBFkwQouyixMQiamqPc,2005
122
123
  netbox_dns/urls/zone_template.py,sha256=w3Gu8qfLCWyHofeLkGZd1HpYSlcslomVlBQJZyqh8kk,1690
123
- netbox_dns/utilities/__init__.py,sha256=M9T8PUFlGddtENzEznHAPbEsz1VFrPcmbD-BGLCsvB4,55
124
+ netbox_dns/utilities/__init__.py,sha256=mmR0JdH1DJVhUKesnO3CZFj0Rw_wrsMPoYTpOOKHl9I,55
124
125
  netbox_dns/utilities/conversions.py,sha256=NS37SoMqXc13wNWRkKnLfyQbVi6QKD33fu5ovTKRo74,1979
125
- netbox_dns/utilities/ipam_autodns.py,sha256=QMCMZkY8YxZL3VeH5xHCQWWd3Cji9Nx0GTUcsjtXsQY,8137
126
+ netbox_dns/utilities/ipam_dnssync.py,sha256=LIUCigDdobPikneY-td3ydY2iK-iDDe75VGxcCBLdP8,8188
126
127
  netbox_dns/validators/__init__.py,sha256=Mr8TvmcJTa8Pubj8TzbFBKfbHhEmGcr5JdQvczEJ39A,72
127
128
  netbox_dns/validators/dns_name.py,sha256=B4A0BOW5pKDjjukvksriRtnLzkYTx_pFjh7eqKo6PBE,3069
128
129
  netbox_dns/validators/dns_value.py,sha256=y2Zga4hmywqDrTBXcMC-sWaFbw4eoY8pySq7cWnMP8Y,2822
@@ -130,13 +131,13 @@ netbox_dns/validators/rfc2317.py,sha256=ivylEiNKlmX2x41rwqDrFkD5CFf9FtpNEfsKHX_p
130
131
  netbox_dns/views/__init__.py,sha256=s41w4o77tIwmhnLjsOsg08R9m3wrlomkkfCLTVQuPzc,196
131
132
  netbox_dns/views/contact.py,sha256=qM9F6MQBvO8ERR7quGLdQ5kW4roNLJ61As8m0qQTapg,2471
132
133
  netbox_dns/views/nameserver.py,sha256=DFr0eybMshc1FW06g4cy9Nk4VRMxRqakI5KtHFiAVRc,3286
133
- netbox_dns/views/record.py,sha256=fHMafCC14C7d6oXbXc2vN-T70OAOaTY77_m3Dct-oiQ,4590
134
+ netbox_dns/views/record.py,sha256=xebtE5XoYyGpp_8O6lywLtU0oXjrrtipnCLePgtNCO0,4703
134
135
  netbox_dns/views/record_template.py,sha256=BkemTBEramLhYqB6HrA80sNgtduW1ZOJwbYs3i7srik,2510
135
136
  netbox_dns/views/registrar.py,sha256=yRQgFm3vgBD21ZQex9asjs0QWegvSHlcyHXLnjvc5xs,2324
136
137
  netbox_dns/views/view.py,sha256=iXBJTc3JD5cD5z0RTcHVTtYV-KNIJGneeoxymXChdUE,2759
137
138
  netbox_dns/views/zone.py,sha256=SKhf_WHcFVpKqFTuUMf-Dmxu1AwFHBeo_DtD8UGFrJ8,5483
138
139
  netbox_dns/views/zone_template.py,sha256=qvXl-bpc1fMc1WFngynj4-Q3-JJDgKdT-r54s4M1D0s,2118
139
- netbox_plugin_dns-1.1b3.dist-info/LICENSE,sha256=I3tDu11bZfhFm3EkV4zOD5TmWgLjnUNLEFwrdjniZYs,1112
140
- netbox_plugin_dns-1.1b3.dist-info/METADATA,sha256=TZ6wKgEaZXVAH0j4IZsRrlfmQZ_kQjhy72ATDEvQmag,6404
141
- netbox_plugin_dns-1.1b3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
142
- netbox_plugin_dns-1.1b3.dist-info/RECORD,,
140
+ netbox_plugin_dns-1.1.0b5.dist-info/LICENSE,sha256=I3tDu11bZfhFm3EkV4zOD5TmWgLjnUNLEFwrdjniZYs,1112
141
+ netbox_plugin_dns-1.1.0b5.dist-info/METADATA,sha256=XOk6Bjyn0rVCul1V3LeGfCcnGVH5E1O7T5EeGg_abWQ,6406
142
+ netbox_plugin_dns-1.1.0b5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
143
+ netbox_plugin_dns-1.1.0b5.dist-info/RECORD,,