-
Notifications
You must be signed in to change notification settings - Fork 27
Home
richm edited this page Sep 13, 2010
·
12 revisions
This is a collection of scripts (shell, perl, python) I use when testing Fedora Directory Server.
Directory Server management code is in dsadmin.py – this uses python-ldap to manage Fedora Directory Server – it provides
- code to manage suffixes and database backends, including chaining backends
- code to manage replication – set up replicas, replication agreements, init replicas, check status
- an Entry class – a high level interface to the lower level python-ldap functions and data structures
from dsadmin import DSAdmin, Entry host1 = "myhost" host2 = "otherhost" port = 389 rootdn = "cn=Directory Manager" rootpw = "itsasecret" srv1 = DSAdmin(host1, port, rootdn, rootpw) replargs = { 'suffix': "dc=example,dc=com", 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl"
- ‘log’ : False
}
srv1.replicaSetupAll(replargs)
srv2 = DSAdmin(host2, port, rootdn, rootpw)
srv2.replicaSetupAll(replargs)
- sleep for a second or two
ent = srv2.getEntry(dn, ldap.SCOPE_BASE)
print “entry was replicated”, ent
There are two Perl modules that provide similar functionality:
- NDSAdmin.pm – uses Mozilla::LDAP
- NDSAdminNL.pm – uses Net::LDAP