From 5025e990e930161160b3f2dc7610a15b3484ed24 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 29 Nov 2007 16:48:32 -0500 Subject: [PATCH] Remove optional arguments from the XML-RPC interface --- ipa-server/xmlrpc-server/funcs.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py index ef196a0a5..eb87ed065 100644 --- a/ipa-server/xmlrpc-server/funcs.py +++ b/ipa-server/xmlrpc-server/funcs.py @@ -331,7 +331,7 @@ class IPAServer: # Higher-level API - def get_aci_entry(self, sattrs=None, opts=None): + def get_aci_entry(self, sattrs, opts=None): """Returns the entry containing access control ACIs.""" dn="%s,%s" % (ACIContainer, self.basedn) @@ -339,7 +339,7 @@ class IPAServer: # General searches - def get_entry_by_dn (self, dn, sattrs=None, opts=None): + def get_entry_by_dn (self, dn, sattrs, opts=None): """Get a specific entry. Return as a dict of values. Multi-valued fields are represented as lists. """ @@ -347,7 +347,7 @@ class IPAServer: filter = "(objectClass=*)" return self.__get_base_entry(dn, filter, sattrs, opts) - def get_entry_by_cn (self, cn, sattrs=None, opts=None): + def get_entry_by_cn (self, cn, sattrs, opts=None): """Get a specific entry by cn. Return as a dict of values. Multi-valued fields are represented as lists. """ @@ -373,7 +373,7 @@ class IPAServer: except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND): return 1 - def get_user_by_uid (self, uid, sattrs=None, opts=None): + def get_user_by_uid (self, uid, sattrs, opts=None): """Get a specific user's entry. Return as a dict of values. Multi-valued fields are represented as lists. """ @@ -382,7 +382,7 @@ class IPAServer: filter = "(uid=" + uid + ")" return self.__get_sub_entry(self.basedn, filter, sattrs, opts) - def get_user_by_principal(self, principal, sattrs=None, opts=None): + def get_user_by_principal(self, principal, sattrs, opts=None): """Get a user entry searching by Kerberos Principal Name. Return as a dict of values. Multi-valued fields are represented as lists. @@ -391,7 +391,7 @@ class IPAServer: filter = "(krbPrincipalName="+self.__safe_filter(principal)+")" return self.__get_sub_entry(self.basedn, filter, sattrs, opts) - def get_user_by_email (self, email, sattrs=None, opts=None): + def get_user_by_email (self, email, sattrs, opts=None): """Get a specific user's entry. Return as a dict of values. Multi-valued fields are represented as lists. """ @@ -400,7 +400,7 @@ class IPAServer: filter = "(mail=" + email + ")" return self.__get_sub_entry(self.basedn, filter, sattrs, opts) - def get_users_by_manager (self, manager_dn, sattrs=None, opts=None): + def get_users_by_manager (self, manager_dn, sattrs, opts=None): """Gets the users that report to a particular manager. """ @@ -412,12 +412,12 @@ class IPAServer: except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND): return [] - def add_user (self, user, user_container=None, opts=None): + def add_user (self, user, user_container, opts=None): """Add a user in LDAP. Takes as input a dict where the key is the attribute name and the value is either a string or in the case of a multi-valued field a list of values. user_container sets where in the tree the user is placed.""" - if user_container is None: + if not user_container: user_container = DefaultUserContainer if self.__is_user_unique(user['uid'], opts) == 0: @@ -543,7 +543,7 @@ class IPAServer: return self.update_entry(config, new_config, opts) - def get_all_users (self, args=None, opts=None): + def get_all_users (self, opts=None): """Return a list containing a User object for each existing user. """ @@ -561,7 +561,7 @@ class IPAServer: return users - def find_users (self, criteria, sattrs=None, searchlimit=-1, timelimit=-1, + def find_users (self, criteria, sattrs, searchlimit=-1, timelimit=-1, opts=None): """Returns a list: counter followed by the results. If the results are truncated, counter will be set to -1.""" @@ -807,7 +807,7 @@ class IPAServer: except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND): return 1 - def get_groups_by_member (self, member_dn, sattrs=None, opts=None): + def get_groups_by_member (self, member_dn, sattrs, opts=None): """Get a specific group's entry. Return as a dict of values. Multi-valued fields are represented as lists. """ @@ -820,12 +820,12 @@ class IPAServer: except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND): return [] - def add_group (self, group, group_container=None, opts=None): + def add_group (self, group, group_container, opts=None): """Add a group in LDAP. Takes as input a dict where the key is the attribute name and the value is either a string or in the case of a multi-valued field a list of values. group_container sets where in the tree the group is placed.""" - if group_container is None: + if not group_container: group_container = DefaultGroupContainer if self.__is_group_unique(group['cn'], opts) == 0: @@ -852,7 +852,7 @@ class IPAServer: finally: self.releaseConnection(conn) - def find_groups (self, criteria, sattrs=None, searchlimit=-1, timelimit=-1, + def find_groups (self, criteria, sattrs, searchlimit=-1, timelimit=-1, opts=None): """Return a list containing a User object for each existing group that matches the criteria.