summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/ldapupdate.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2009-03-23 15:14:31 -0400
committerRob Crittenden <rcritten@redhat.com>2009-03-25 11:02:59 -0400
commitfcfcc765249c97ff621d298a48e7bb6474134f5b (patch)
treeaca0795c1888c22a8f3b7ebde54602aad8bff02f /ipaserver/install/ldapupdate.py
parent7d19cee7fc6ff8fc5e2af26a1d7f291acafcb3bf (diff)
downloadfreeipa-fcfcc765249c97ff621d298a48e7bb6474134f5b.tar.gz
freeipa-fcfcc765249c97ff621d298a48e7bb6474134f5b.tar.xz
freeipa-fcfcc765249c97ff621d298a48e7bb6474134f5b.zip
Translate variables on all lines and sort files to be updated
Only the dn and the first line of any entry that was spread across multiple lines were getting passed through the template engine. If we are given a directory to process, sort the files in that directory so the order can be predicted. Some updates rely on others.
Diffstat (limited to 'ipaserver/install/ldapupdate.py')
-rw-r--r--ipaserver/install/ldapupdate.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py
index bc9a6cd9c..f002595d2 100644
--- a/ipaserver/install/ldapupdate.py
+++ b/ipaserver/install/ldapupdate.py
@@ -228,9 +228,10 @@ class LDAPUpdate:
if dn is None:
raise BadSyntax, "dn is not defined in the update"
+ line = self.__template_str(line)
if line.startswith(' '):
v = d[len(d) - 1]
- v = v + " " + line.strip()
+ v = v + line[1:]
d[len(d) - 1] = v
update[index] = d
continue
@@ -246,7 +247,6 @@ class LDAPUpdate:
attr = values[1].strip()
value = values[2].strip()
- value = self.__template_str(value)
new_value = ""
if index == "default":
@@ -514,9 +514,10 @@ class LDAPUpdate:
if (entry.dn == "cn=schema"):
updated = self.is_schema_updated(entry.toDict())
else:
- if len(changes) > 1:
+ if len(changes) >= 1:
updated = True
logging.debug("%s" % changes)
+ logging.debug("Live %d, updated %d" % (self.live_run, updated))
if self.live_run and updated:
self.conn.updateEntry(entry.dn, entry.origDataDict(), entry.toDict())
logging.info("Done")
@@ -545,6 +546,7 @@ class LDAPUpdate:
f.append(os.path.join(path, name))
if not recursive:
break
+ f.sort()
return f
def update(self, files):