summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/dns.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/plugins/dns.py')
-rw-r--r--ipalib/plugins/dns.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index 8a3bc5ed..fe32efcc 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -1495,6 +1495,13 @@ class dnsrecord(LDAPObject):
def get_dn(self, *keys, **options):
if self.is_pkey_zone_record(*keys):
+ dn = self.api.Object[self.parent_object].get_dn(*keys[:-1], **options)
+ # zone must exist
+ ldap = self.api.Backend.ldap2
+ try:
+ (dn_, zone) = ldap.get_entry(dn, [])
+ except errors.NotFound:
+ self.api.Object['dnszone'].handle_not_found(keys[-2])
return self.api.Object[self.parent_object].get_dn(*keys[:-1], **options)
return super(dnsrecord, self).get_dn(*keys, **options)