diff options
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 261519a..bfeafd2 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 + "]" ) @@ -38,7 +40,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 |