summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipalib/plugins/dns.py3
-rw-r--r--tests/test_xmlrpc/test_dns_plugin.py10
2 files changed, 11 insertions, 2 deletions
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index 5484119d4..8c269c0a0 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -2455,8 +2455,7 @@ class dnsrecord_mod(LDAPUpdate):
(dn_, old_entry) = ldap.get_entry(dn, _record_attributes,
normalize=self.obj.normalize_dn)
except errors.NotFound:
- if updated_attrs:
- self.obj.handle_not_found(*keys)
+ self.obj.handle_not_found(*keys)
if updated_attrs:
for attr in updated_attrs:
diff --git a/tests/test_xmlrpc/test_dns_plugin.py b/tests/test_xmlrpc/test_dns_plugin.py
index 6a54bcb63..3c2dc005d 100644
--- a/tests/test_xmlrpc/test_dns_plugin.py
+++ b/tests/test_xmlrpc/test_dns_plugin.py
@@ -590,6 +590,16 @@ class test_dns(Declarative):
dict(
+ desc='Try to modify nonexistent record in zone %r' % dnszone1,
+ command=('dnsrecord_mod',
+ [dnszone1, u'ghostname'],
+ {'aaaarecord': u'f001:baad::1'}),
+ expected=errors.NotFound(
+ reason=u'ghostname: DNS resource record not found'),
+ ),
+
+
+ dict(
desc='Modify AAAA record in %r in zone %r' % (dnsres1, dnszone1),
command=('dnsrecord_mod', [dnszone1, dnsres1], {'aaaarecord': u'ff02::1'}),
expected={