summaryrefslogtreecommitdiff
path: root/buildscripts/cleanbb.py
diff options
context:
space:
mode:
authorRichard Kreuter <richard@10gen.com>2010-07-23 15:52:35 -0400
committerRichard Kreuter <richard@10gen.com>2010-07-23 15:52:52 -0400
commit5eb10576074a6aeb00982a07a65f1c770b3e14d9 (patch)
treeedca0486e1e3d6b69c8c2404e58312b613f99133 /buildscripts/cleanbb.py
parent30d823b6289a70250e171816d4aec6fa86d46be3 (diff)
downloadmongo-5eb10576074a6aeb00982a07a65f1c770b3e14d9.tar.gz
Add a --nokill to cleanbb, use it in smoke.py
Diffstat (limited to 'buildscripts/cleanbb.py')
-rw-r--r--buildscripts/cleanbb.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/buildscripts/cleanbb.py b/buildscripts/cleanbb.py
index e32f34b82da..261519a4977 100644
--- a/buildscripts/cleanbb.py
+++ b/buildscripts/cleanbb.py
@@ -3,6 +3,7 @@ import sys
import os
import utils
import time
+from optparse import OptionParser
cwd = os.getcwd();
if cwd.find("buildscripts" ) > 0 :
@@ -45,12 +46,14 @@ def killprocs( signal="" ):
return killed
-def cleanup( root ):
+def cleanup( root , nokill ):
-
- if killprocs() > 0:
- time.sleep(3)
- killprocs("-9")
+ if nokill:
+ print "nokill requested, not killing anybody"
+ else:
+ if killprocs() > 0:
+ time.sleep(3)
+ killprocs("-9")
# delete all regular files, directories can stay
# NOTE: if we delete directories later, we can't delete diskfulltest
@@ -62,7 +65,12 @@ def cleanup( root ):
if __name__ == "__main__":
+ parser = OptionParser(usage="read the script")
+ parser.add_option("--nokill", dest='nokill', default=False, action='store_true')
+ (options, args) = parser.parse_args()
+
root = "/data/db/"
- if len( sys.argv ) > 1:
- root = sys.argv[1]
- cleanup( root )
+ if len(args) > 0:
+ root = args[0]
+
+ cleanup( root , options.nokill )