import string, re, time, ldap, getopt, sys, os, pwd, posix, socket, base64, sha, shutil, errno, tarfile, grp
from userdir_ldap import *;
+from userdir_exceptions import *
global Allowed;
global CurrentHost;
# Fetch all the hosts
global HostAttrs
if HostAttrs == None:
- raise "No Hosts"
+ raise UDEmptyList, "No Hosts"
for x in HostAttrs:
if x[1].has_key("hostname") == 0 or \
global HostAttrs
if HostAttrs == None:
- raise "No Hosts";
+ raise UDEmptyList, "No Hosts"
for x in HostAttrs:
if x[1].has_key("hostname") == 0 or \
["hostname"])
if hostnames == None:
- raise "No Hosts"
+ raise UDEmptyList, "No Hosts"
seen = set()
for x in hostnames:
"mailWhitelist", "sudoPassword", "objectClass", "accountStatus"])
if PasswdAttrs is None:
- raise "No Users"
+ raise UDEmptyList, "No Users"
# Fetch all the hosts
HostAttrs = l.search_s(HostBaseDn,ldap.SCOPE_ONELEVEL,"sshRSAHostKey=*",\
"UDFormatError": """Exception raised for data format errors.""",
"UDExecuteError": """Exception raised for subprocess execution errors.""",
"UDNotAllowedError": """Exception raised for attempts to modify off-limits or disabled entries.""",
+ "UDEmptyList": """Exception raised for empty list objects.""",
}
def construct_udld_exception(name, description):