diff options
author | Mike Dirolf <mike@10gen.com> | 2010-07-23 16:34:55 -0400 |
---|---|---|
committer | Mike Dirolf <mike@10gen.com> | 2010-07-23 16:34:55 -0400 |
commit | 6de6bd1ddde583353894b3ceb9c76784b3f4593b (patch) | |
tree | 9e47870adc8913e6c4feccdc16ce4587386ee1c4 /buildscripts | |
parent | a5bd01525a3b9f38ced4141734b722129e14cfa5 (diff) | |
parent | 6e2f7ff4be95c3bba1f9a47c664fb5a08c426a2d (diff) | |
download | mongo-6de6bd1ddde583353894b3ceb9c76784b3f4593b.tar.gz |
Merge branch 'master' of github.com:mongodb/mongo
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/cleanbb.py | 24 | ||||
-rwxr-xr-x | buildscripts/smoke.py | 7 |
2 files changed, 22 insertions, 9 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 ) diff --git a/buildscripts/smoke.py b/buildscripts/smoke.py index c2d28ca05a1..a94504efd54 100755 --- a/buildscripts/smoke.py +++ b/buildscripts/smoke.py @@ -138,7 +138,12 @@ class mongod(object): self.port += 1 self.slave = True if os.path.exists ( dirName ): - call( ["python", "buildscripts/cleanbb.py", dirName] ) + if 'slave' in self.kwargs: + argv = ["python", "buildscripts/cleanbb.py", '--nokill', dirName] + + else: + argv = ["python", "buildscripts/cleanbb.py", dirName] + call( argv ) utils.ensureDir( dirName ) argv = [mongodExecutable, "--port", str(self.port), "--dbpath", dirName] if self.kwargs.get('smallOplog'): |