diff options
author | Rob Crittenden <rcritten@redhat.com> | 2009-03-23 15:14:31 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-03-25 11:02:59 -0400 |
commit | fcfcc765249c97ff621d298a48e7bb6474134f5b (patch) | |
tree | aca0795c1888c22a8f3b7ebde54602aad8bff02f /ipaserver/install/ldapupdate.py | |
parent | 7d19cee7fc6ff8fc5e2af26a1d7f291acafcb3bf (diff) | |
download | freeipa.git-fcfcc765249c97ff621d298a48e7bb6474134f5b.tar.gz freeipa.git-fcfcc765249c97ff621d298a48e7bb6474134f5b.tar.xz freeipa.git-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.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py index bc9a6cd9..f002595d 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): |