s4-dbcheck: support the 'none' option for prompts
authorAndrew Tridgell <tridge@samba.org>
Tue, 5 Jul 2011 03:03:18 +0000 (13:03 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 5 Jul 2011 06:22:40 +0000 (08:22 +0200)
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Jul  5 08:22:40 CEST 2011 on sn-devel-104

source4/scripting/python/samba/dbchecker.py

index 6a334f40abc5aa2beda3f420e1f48b7658f5f10c..4209a3b78cdfe2baa224ad9a6715049fbd3577bb 100644 (file)
@@ -100,10 +100,18 @@ class dbcheck(object):
             return False
         if self.quiet:
             return self.yes
-        forced = self.yes or getattr(self, all_attr)
+        if getattr(self, all_attr) == 'NONE':
+            return False
+        if getattr(self, all_attr) == 'ALL':
+            forced = True
+        else:
+            forced = self.yes
         c = common.confirm(msg, forced=forced, allow_all=True)
         if c == 'ALL':
-            setattr(self, all_attr, True)
+            setattr(self, all_attr, 'ALL')
+            return True
+        if c == 'NONE':
+            setattr(self, all_attr, 'NONE')
             return True
         return c