summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/dns.py
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2016-05-19 14:19:07 +0200
committerJan Cholasta <jcholast@redhat.com>2016-05-25 16:06:26 +0200
commit71f960457ed2e2fe53c4c8ea5c37b50180d89a6a (patch)
treeae6365d089526f3bd9060ed63b026bbfa9178544 /ipalib/plugins/dns.py
parentf8cf136c55aeb20785c08c1fa6abf33cc3fe6291 (diff)
downloadfreeipa-71f960457ed2e2fe53c4c8ea5c37b50180d89a6a.tar.gz
freeipa-71f960457ed2e2fe53c4c8ea5c37b50180d89a6a.tar.xz
freeipa-71f960457ed2e2fe53c4c8ea5c37b50180d89a6a.zip
ipalib: make optional positional command arguments actually optional
Fix several plugins not to assume optional positional arguments have a value of None when not specified. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipalib/plugins/dns.py')
-rw-r--r--ipalib/plugins/dns.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index 8a31dcfeb..d30f50b29 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -1654,8 +1654,8 @@ def _convert_to_idna(value):
pass
return None
-def _create_idn_filter(cmd, ldap, *args, **options):
- term = args[-1]
+
+def _create_idn_filter(cmd, ldap, term=None, **options):
if term:
#include idna values to search
term_idna = _convert_to_idna(term)
@@ -4191,11 +4191,12 @@ class dnsrecord_find(LDAPSearch):
continue
yield option
- def pre_callback(self, ldap, filter, attrs_list, base_dn, scope, *args, **options):
+ def pre_callback(self, ldap, filter, attrs_list, base_dn, scope,
+ dnszoneidnsname, *args, **options):
assert isinstance(base_dn, DN)
# validate if zone is master zone
- self.obj.check_zone(args[-2], **options)
+ self.obj.check_zone(dnszoneidnsname, **options)
filter = _create_idn_filter(self, ldap, *args, **options)
return (filter, base_dn, ldap.SCOPE_SUBTREE)