s4:upgradeprovision Rework update_machine_account_password() tranactions
authorAndrew Bartlett <abartlet@samba.org>
Thu, 26 Nov 2009 21:10:54 +0000 (08:10 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 27 Nov 2009 05:05:05 +0000 (16:05 +1100)
This balances the transaction_begin() and transactin_prepare_commit() calls

Andrew Bartlett

source4/scripting/bin/upgradeprovision

index 81cf3388dfcd3993b6b37ba781ab7981ee2c4e23..9298c02672ffe47a9e30d7780713078e29b60ab9 100755 (executable)
@@ -712,10 +712,12 @@ def update_machine_account_password(newpaths,paths,creds,session,names):
                                    machinepass=machinepass,
                                    key_version_number=kvno,
                                    secure_channel_type=secrets_msg[0]["secureChannelType"])
-       sam_ldb.transaction_prepare_commit()
-       secrets_ldb.transaction_prepare_commit()
-       sam_ldb.transaction_commit()
-       secrets_ldb.transaction_commit()
+               sam_ldb.transaction_prepare_commit()
+               secrets_ldb.transaction_prepare_commit()
+               sam_ldb.transaction_commit()
+               secrets_ldb.transaction_commit()
+       else:
+               secrets_ldb.transaction_cancel()
 
 # From here start the big steps of the program
 # First get files paths