From 0b254e8b1e60b46ce29fecedbc088921a526fbd8 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 14 Sep 2012 12:05:12 -0400 Subject: Always handle NotFound error in dnsrecord-mod When there were no updated attrs when modifying a nonexistent DNS record, the error was not handled and caused an internal server error later (old_entry was used uninitialized). https://fedorahosted.org/freeipa/ticket/3055 --- tests/test_xmlrpc/test_dns_plugin.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/test_xmlrpc') diff --git a/tests/test_xmlrpc/test_dns_plugin.py b/tests/test_xmlrpc/test_dns_plugin.py index 6a54bcb6..3c2dc005 100644 --- a/tests/test_xmlrpc/test_dns_plugin.py +++ b/tests/test_xmlrpc/test_dns_plugin.py @@ -589,6 +589,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'}), -- cgit