def group_del(groupname): if is_group_exist(groupname) == False: ret = 1 result = {'msg': 'group doesn\'t exists'} else: dn = group_dn(groupname) result = ldap_del(dn) if result is not None: ret = 0 else: ret = 1000 return dict({'ret': ret, 'ldapresult': result})
def group_del(groupname): if is_group_exist(groupname) == False: ret = 1 result = {"msg": "group doesn't exists"} else: dn = group_dn(groupname) result = ldap_del(dn) if result is not None: ret = 0 else: ret = 1000 return dict({"ret": ret, "ldapresult": result})
def user_del(username): if is_user_exist(username) == False: ret = 1 result = {'msg':'user doesn\'t exists'} else: dn = user_dn(username) result = ldap_del(dn) if result is not None: ret = 0 else: ret = 1000 return dict({'ret':ret,'ldapresult':result})