Permalink
Browse files

python-2.4 compatible version of cleanbb.py

  • Loading branch information...
1 parent bb76d2d commit 64f3b376ca0bd04712bb6e02a508a3a0f4fbab63 Dan Crosta committed Mar 26, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 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

0 comments on commit 64f3b37

Please sign in to comment.