s4-provision: allow provision modifies to add records
authorAndrew Tridgell <tridge@samba.org>
Tue, 5 Jan 2010 22:15:35 +0000 (09:15 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 8 Jan 2010 02:02:59 +0000 (13:02 +1100)
we need to recognise a changetype of 'add'

source4/scripting/python/samba/__init__.py

index 5d61c1bd8cbd171065d491929e2984586a0f8f4c..d7df6b979bfbc7cb1726166d1e9e9d3b322454c8 100644 (file)
@@ -255,7 +255,10 @@ class Ldb(ldb.Ldb):
         :param ldif: LDIF text.
         """
         for changetype, msg in self.parse_ldif(ldif):
-            self.modify(msg, controls)
+            if (changetype == ldb.CHANGETYPE_ADD):
+                self.add(msg, controls)
+            else:
+                self.modify(msg, controls)
 
     def set_domain_sid(self, sid):
         """Change the domain SID used by this LDB.