removed leading spaces from embedded ldif
authorAndrew Tridgell <tridge@samba.org>
Thu, 12 Mar 2009 02:13:14 +0000 (13:13 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 12 Mar 2009 02:13:14 +0000 (13:13 +1100)
This fixes the problem with the setpassword command failing like this:
   Error: First line of ldif must be a dn not '    dn'

source4/scripting/python/samba/samdb.py

index 614970d3ec5b6bfadd144853fd29d99ebfcb76ef..740806f2667a21c8e16abbc82b42522aa1728731 100644 (file)
@@ -175,10 +175,10 @@ userAccountControl: %u
             user_dn = res[0].dn
 
             setpw = """
-    dn: %s
-    changetype: modify
-    replace: userPassword
-    userPassword: %s
+dn: %s
+changetype: modify
+replace: userPassword
+userPassword: %s
     """ % (user_dn, password)
 
             self.modify_ldif(setpw)
@@ -229,12 +229,12 @@ userAccountControl: %u
                 accountExpires = glue.unix2nttime(expiry_seconds + int(time.time()))
 
             mod = """
-    dn: %s
-    changetype: modify
-    replace: userAccountControl
-    userAccountControl: %u
-    replace: accountExpires
-    accountExpires: %u
+dn: %s
+changetype: modify
+replace: userAccountControl
+userAccountControl: %u
+replace: accountExpires
+accountExpires: %u
     """ % (res[0].dn, userAccountControl, accountExpires)
             # now change the database
             self.modify_ldif(mod)