The synaps.auth.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 FakeLDAP

Bases: object

Fake LDAP connection.

add_s(dn, attr)

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 – a dn
  • attrs

    a list of tuples in the following form:

    ([MOD_ADD | MOD_DELETE | MOD_REPACE], attribute, value)
    
modrdn_s(dn, newrdn)
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.

exception NO_SUCH_OBJECT

Bases: exceptions.Exception

Duplicate exception class from real LDAP module.

exception OBJECT_CLASS_VIOLATION

Bases: exceptions.Exception

Duplicate exception class from real LDAP module.

exception SERVER_DOWN

Bases: exceptions.Exception

Duplicate exception class from real LDAP module.

class Store

Bases: object

classmethod instance()
initialize(_uri)

Opens a fake connection with an LDAP server.

Previous topic

The synaps.api.cloudwatch.monitor Module

Next topic

The synaps.auth.ldapdriver Module

This Page