Tool for doing configuration updates over LDAP
This tool takes as input a file which contains basically an LDIF, prefixed with a command: default, add, remove or only. These define the operations to perform such as adding new entries, adding new sub-entries to an existing entry, adding or modifying attributes in a record. If an index entry is modified a task is created to re-create the index. Schema may be added using this tool. 454031
This commit is contained in:
1 parent
d33b7fc839
commit
ec57bc3e44
5 files changed
+559
-1
No files matched your search
@@ -19,6 +19,7 @@ import ldap
|
||||
import ldif
|
||||
import re
|
||||
import cStringIO
|
||||
import copy
|
||||
|
||||
import ipa.ipautil
|
||||
|
||||
@@ -33,6 +34,13 @@ def utf8_encode_values(values):
|
||||
else:
|
||||
return utf8_encode_value(values)
|
||||
|
||||
def copy_CIDict(x):
|
||||
"""Do a deep copy of a CIDict"""
|
||||
y = {}
|
||||
for key, value in x.iteritems():
|
||||
y[copy.deepcopy(key)] = copy.deepcopy(value)
|
||||
return y
|
||||
|
||||
class Entity:
|
||||
"""This class represents an IPA user. An LDAP entry consists of a DN
|
||||
and a list of attributes. Each attribute consists of a name and a list of
|
||||
@@ -63,7 +71,7 @@ class Entity:
|
||||
self.dn = ''
|
||||
self.data = ipa.ipautil.CIDict()
|
||||
|
||||
self.orig_data = ipa.ipautil.CIDict(self.data)
|
||||
self.orig_data = ipa.ipautil.CIDict(copy_CIDict(self.data))
|
||||
|
||||
def __nonzero__(self):
|
||||
"""This allows us to do tests like if entry: returns false if there is no data,
|
||||
|
||||
Reference in new issue
Block a user