Table Of Contents

Previous topic

common Package

Next topic

sql Package

This Page

ldap Package

ldap Package

core Module

class keystone.common.ldap.core.BaseLdap(conf)

Bases: object

DEFAULT_ID_ATTR = 'cn'
DEFAULT_OBJECTCLASS = None
DEFAULT_OU = None
DEFAULT_STRUCTURAL_CLASSES = None
DEFAULT_SUFFIX = 'dc=example,dc=com'
DUMB_MEMBER_DN = 'cn=dumb,dc=nonexistent'
affirm_unique(values)
attribute_ignore = []
attribute_mapping = {}
create(values)
delete(id)
get(id, filter=None)
get_all(filter=None)
get_connection(user=None, password=None)
get_page(marker, limit)
get_page_markers(marker, limit)
model = None
options_name = None
tree_dn = None
update(id, values, old_obj=None)
class keystone.common.ldap.core.LdapWrapper(url)

Bases: object

add_s(dn, attrs)
delete_s(dn)
modify_s(dn, modlist)
search_s(dn, scope, query)
simple_bind_s(user, password)
keystone.common.ldap.core.ldap2py(val)
keystone.common.ldap.core.py2ldap(val)
keystone.common.ldap.core.safe_iter(attrs)

fakeldap Module

Fake LDAP server for test harness.

This class does very little error checking, and knows nothing about ldap class definitions. It implements the minimum emulation of the python ldap library to work with nova.

class keystone.common.ldap.fakeldap.FakeLdap(url)

Bases: object

Fake LDAP connection.

add_s(dn, attrs)

Add an object with the specified attributes at dn.

delete_s(dn)

Remove the ldap object at specified dn.

modify_s(dn, attrs)

Modify the object at dn using the attribute list.

Parameters:
  • dn – an LDAP DN
  • attrs – a list of tuples in the following form: ([MOD_ADD | MOD_DELETE | MOD_REPACE], attribute, value)
search_s(dn, scope, query=None, fields=None)

Search for all matching objects under dn using the query.

Args: dn – dn to search under scope – only SCOPE_BASE and SCOPE_SUBTREE are supported query – query to filter objects by fields – fields to return. Returns all fields if not specified

simple_bind_s(dn, password)

This method is ignored, but provided for compatibility.

unbind_s()

This method is ignored, but provided for compatibility.

class keystone.common.ldap.fakeldap.FakeShelve

Bases: dict

classmethod get_instance()
sync()