domain_update: Add an additional error with revision
authorGarming Sam <garming@catalyst.net.nz>
Wed, 13 Dec 2017 00:35:14 +0000 (13:35 +1300)
committerGarming Sam <garming@samba.org>
Wed, 20 Dec 2017 22:13:11 +0000 (23:13 +0100)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/domain_update.py

index 7e99e55..1f8e5de 100644 (file)
@@ -137,7 +137,12 @@ class DomainUpdate(object):
         self.check_updates_range(min_update, expected_update)
 
         expected_version = functional_level_to_version[functional_level]
-        if update_revision and int(res[0]['revision'][0]) < expected_version:
+        found_version = int(res[0]['revision'][0])
+        if update_revision and found_version < expected_version:
+            if not self.fix:
+                raise DomainUpdateException("Revision is not high enough. Fix is set to False."
+                                            "\nExpected: %dGot: %d" % (expected_version,
+                                                                       found_version))
             self.samdb.modify_ldif("""dn: %s
 changetype: modify
 replace: revision