Source

iredadmin-ose / libs / ldaplib / domain.py

Diff from to

libs/ldaplib/domain.py

         self.domain = web.safestr(data.get('domainName', '')).strip().lower()
 
         # Check domain name.
-        if not iredutils.isDomain(self.domain):
+        if not iredutils.is_domain(self.domain):
             return (False, 'INVALID_DOMAIN_NAME')
 
         # Check whether domain name already exist (domainName, domainAliasName).
         connutils = connUtils.Utils()
-        if connutils.isDomainExists(self.domain):
+        if connutils.is_domain_exists(self.domain):
             return (False, 'ALREADY_EXISTS')
 
-        self.dn = ldaputils.convKeywordToDN(self.domain, accountType='domain')
+        self.dn = ldaputils.convert_keyword_to_dn(self.domain, accountType='domain')
         if self.dn[0] is False:
             return self.dn
 
     # List all domain admins.
     def getDomainAdmins(self, domain):
         domain = web.safestr(domain)
-        dn = ldaputils.convKeywordToDN(domain, accountType='domain')
+        dn = ldaputils.convert_keyword_to_dn(domain, accountType='domain')
         if dn[0] is False:
             return dn
 
     def getDomainDefaultUserQuota(self, domain, domainAccountSetting=None,):
         # Return 0 as unlimited.
         self.domain = web.safestr(domain)
-        self.dn = ldaputils.convKeywordToDN(self.domain, accountType='domain')
+        self.dn = ldaputils.convert_keyword_to_dn(self.domain, accountType='domain')
         if self.dn[0] is False:
             return self.dn
 
 
         domains = [str(v).lower()
                    for v in domains
-                   if iredutils.isDomain(v)
+                   if iredutils.is_domain(v)
                   ]
 
         if not domains:
 
         msg = {}
         for domain in domains:
-            dn = ldaputils.convKeywordToDN(web.safestr(domain), accountType='domain')
+            dn = ldaputils.convert_keyword_to_dn(web.safestr(domain), accountType='domain')
             if dn[0] is False:
                 return dn
 
         connutils = connUtils.Utils()
         for domain in domains:
             self.domain = web.safestr(domain)
-            self.dn = ldaputils.convKeywordToDN(self.domain, accountType='domain')
+            self.dn = ldaputils.convert_keyword_to_dn(self.domain, accountType='domain')
             if self.dn[0] is False:
                 return self.dn
 
     @decorators.require_domain_access
     def profile(self, domain):
         self.domain = web.safestr(domain)
-        self.dn = ldaputils.convKeywordToDN(self.domain, accountType='domain')
+        self.dn = ldaputils.convert_keyword_to_dn(self.domain, accountType='domain')
         if self.dn[0] is False:
             return self.dn
 
     def update(self, profile_type, domain, data):
         self.profile_type = web.safestr(profile_type)
         self.domain = web.safestr(domain)
-        self.domaindn = ldaputils.convKeywordToDN(self.domain, accountType='domain')
+        self.domaindn = ldaputils.convert_keyword_to_dn(self.domain, accountType='domain')
         if self.domaindn[0] is False:
             return self.domaindn
 
                 mod_attrs += [(ldap.MOD_REPLACE, 'accountStatus', accountStatus)]
 
         try:
-            dn = ldaputils.convKeywordToDN(self.domain, accountType='domain')
+            dn = ldaputils.convert_keyword_to_dn(self.domain, accountType='domain')
             if dn[0] is False:
                 return dn