diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-07-13 10:12:48 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-07-13 12:51:05 +0200 |
commit | 303b57c295c4712c0bd606e893e39dff1cbe3e65 (patch) | |
tree | b22fed345baa3560101b37b8b91b4670ba78b257 | |
parent | 5064d73672eecb2750d64f84c126f82781b0191b (diff) | |
download | samba-303b57c295c4712c0bd606e893e39dff1cbe3e65.tar.gz samba-303b57c295c4712c0bd606e893e39dff1cbe3e65.tar.bz2 samba-303b57c295c4712c0bd606e893e39dff1cbe3e65.zip |
dbcheck: only fix replPropertyMetaData if we included it in the search
if we didn't find a replPropertyMetaData attribute at all then don't
try fixing it
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
-rw-r--r-- | source4/scripting/python/samba/dbchecker.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/source4/scripting/python/samba/dbchecker.py b/source4/scripting/python/samba/dbchecker.py index a352c509fd..8de1d26775 100644 --- a/source4/scripting/python/samba/dbchecker.py +++ b/source4/scripting/python/samba/dbchecker.py @@ -417,6 +417,7 @@ class dbcheck(object): error_count = 0 list_attrs_from_md = [] list_attrs_seen = [] + got_repl_property_meta_data = False for attrname in obj: if attrname == 'dn': @@ -424,6 +425,7 @@ class dbcheck(object): if str(attrname).lower() == 'replpropertymetadata': list_attrs_from_md = self.process_metadata(obj[attrname]) + got_repl_property_meta_data = True continue @@ -463,17 +465,18 @@ class dbcheck(object): break show_dn = True - for att in list_attrs_seen: - if not att in list_attrs_from_md: - if show_dn: - self.report("On object %s" % dn) - show_dn = False - error_count += 1 - self.report("ERROR: Attribute %s not present in replication metadata" % att) - if not self.confirm_all("Fix missing replPropertyMetaData element '%s'" % att, 'fix_all_metadata'): - self.report("Not fixing missing replPropertyMetaData element '%s'" % att) - continue - self.fix_metadata(dn, att) + if got_repl_property_meta_data: + for att in list_attrs_seen: + if not att in list_attrs_from_md: + if show_dn: + self.report("On object %s" % dn) + show_dn = False + error_count += 1 + self.report("ERROR: Attribute %s not present in replication metadata" % att) + if not self.confirm_all("Fix missing replPropertyMetaData element '%s'" % att, 'fix_all_metadata'): + self.report("Not fixing missing replPropertyMetaData element '%s'" % att) + continue + self.fix_metadata(dn, att) return error_count |