From 49321571ea592be2307eef101cc783f883aa2503 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Sun, 5 Sep 2010 03:00:05 +0400 Subject: upgradeprovision: avoid working with None objects ... --- source4/scripting/bin/upgradeprovision | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision index 39b5042da4..6697c821f9 100755 --- a/source4/scripting/bin/upgradeprovision +++ b/source4/scripting/bin/upgradeprovision @@ -1657,15 +1657,16 @@ if __name__ == '__main__': doit = False if deltaattr is not None and len(deltaattr) > 1: doit = True - deltaattr.remove("dn") - for att in deltaattr: - if att.lower() == "dn": - continue - if deltaattr.get(att) is not None \ - and deltaattr.get(att).flags() != FLAG_MOD_ADD: - doit = False - elif deltaattr.get(att) is None: - doit = False + if doit: + deltaattr.remove("dn") + for att in deltaattr: + if att.lower() == "dn": + continue + if deltaattr.get(att) is not None \ + and deltaattr.get(att).flags() != FLAG_MOD_ADD: + doit = False + elif deltaattr.get(att) is None: + doit = False if doit: message(CHANGE, "Applying delta to @ATTRIBUTES") deltaattr.dn = ldb.Dn(basesam, "@ATTRIBUTES") -- cgit