samba-tool: exit with non-zero status on dbcheck failure
authorAndrew Tridgell <tridge@samba.org>
Fri, 17 Jun 2011 04:40:48 +0000 (14:40 +1000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 17 Jun 2011 05:25:42 +0000 (15:25 +1000)
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/scripting/python/samba/netcmd/dbcheck.py

index 9f12136de81bf15a0141882e9e4f10eaf0040402..b0d77f2fd9525723fd6fb0ebcc93604552ecd5e7 100644 (file)
@@ -18,7 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-import samba, ldb
+import samba, ldb, sys
 import samba.getopt as options
 from samba.auth import system_session
 from samba.samdb import SamDB
@@ -178,3 +178,5 @@ class cmd_dbcheck(Command):
         if error_count != 0 and not self.fix:
             print("Please use --fix to fix these errors")
         print('Checked %u objects (%u errors)' % (len(res), error_count))
+        if error_count != 0:
+            sys.exit(1)