diff options
author | Dan Crosta <dcrosta@10gen.com> | 2012-03-26 11:38:52 -0400 |
---|---|---|
committer | Dan Crosta <dcrosta@10gen.com> | 2012-03-26 11:39:22 -0400 |
commit | bf8e75aa2d8c908a8d6d205da9705faff09df6bd (patch) | |
tree | af55851f195e7e999dfbdd22b607fb04b3dc7d20 /buildscripts/cleanbb.py | |
parent | a1c41fa4cc8b909bbcd703da0d0e65a3c7912fbb (diff) | |
download | mongo-bf8e75aa2d8c908a8d6d205da9705faff09df6bd.tar.gz |
python-2.4 compatible version of cleanbb.py
Diffstat (limited to 'buildscripts/cleanbb.py')
-rw-r--r-- | buildscripts/cleanbb.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/buildscripts/cleanbb.py b/buildscripts/cleanbb.py index 5d0d5a4e4ef..84dc859dbdd 100644 --- a/buildscripts/cleanbb.py +++ b/buildscripts/cleanbb.py @@ -1,13 +1,15 @@ import sys -import os +import os, os.path import utils import time from optparse import OptionParser -cwd = os.getcwd(); -if cwd.find("buildscripts" ) > 0 : - cwd = cwd.partition( "buildscripts" )[0] +# set cwd to the root mongo dir, one level up from this +# file's location (if we're not already running from there) +cwd = os.getcwd() +if os.path.basename(cwd) == 'buildscripts': + cwd = os.path.dirname(cwd) print( "cwd [" + cwd + "]" ) @@ -44,7 +46,7 @@ def killprocs( signal="" ): if not shouldKill( x ): continue - pid = x.partition( " " )[0] + pid = x.split( " " )[0] print( "killing: " + x ) utils.execsys( "/bin/kill " + signal + " " + pid ) killed = killed + 1 |