Module ldap
[hide private]
[frames] | no frames]

Module ldap

source code

Simplify interaction with and querying of an LDAP server


Author: Brian Bockelman

Classes [hide private]
  _hdict
Hashable dictionary; used to make LdapData objects hashable.
  LdapData
Class representing the logical information in the GLUE entry.
Functions [hide private]
 
read_ldap(fp, multi=False)
Convert a file stream into LDAP entries.
source code
 
query_bdii(cp, query='(objectClass=GlueCE)', base='o=grid')
Query a BDII for data.
source code
 
compareLists(l1, l2) source code
 
normalizeDN(dn_tuple) source code
 
compareDN(ldif1, ldif2) source code
 
compareObjectClass(ldif1, ldif2) source code
 
read_bdii(cp, query='', base='o=grid', multi=False)
Query a BDII instance, then parse the results.
source code
 
getSiteList(cp)
Get the listing of all sites in a BDII.
source code
 
prettyDN(dn_list)
Take the DN in list form and transform it back into the traditional, comma-separated format.
source code
Function Details [hide private]

read_ldap(fp, multi=False)

source code 

Convert a file stream into LDAP entries.

Parameters:
  • fp (File-like object) - Input stream containing LDIF data.
  • multi - If True, then the resulting LdapData objects can have multiple values per GLUE attribute.
Returns:
List containing one LdapData object per LDIF entry.

query_bdii(cp, query='(objectClass=GlueCE)', base='o=grid')

source code 

Query a BDII for data.

Parameters:
  • cp (ConfigParser) - Site configuration; will read the bdii.endpoint entry to find the LDAP endpoint
  • query - Query string for the LDAP server.
  • base - Base DN for the LDAP server.
Returns:
File stream of data returned by the BDII.

read_bdii(cp, query='', base='o=grid', multi=False)

source code 

Query a BDII instance, then parse the results.

Parameters:
  • cp (ConfigParser) - Site configuration; see query_bdii
  • query - LDAP query filter to use
  • base - Base DN to query on.
  • multi - If True, then resulting LdapData can have multiple values per attribute
Returns:
List of LdapData objects representing the data the BDII returned.

getSiteList(cp)

source code 

Get the listing of all sites in a BDII.

Parameters:
  • cp (ConfigParser) - Site configuration; see query_bdii.
Returns:
List of site names.