diff options
author | Eliot Horowitz <eliot@10gen.com> | 2012-08-22 17:34:48 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2012-09-11 16:11:22 -0400 |
commit | eb0006626a6658963e30f6efa5f29b17db79d5f8 (patch) | |
tree | fb14cf113491ca147b470971dcd5174a26d0da46 /buildscripts/s3del.py | |
parent | 9a2f402e64cab63c6d94c6a00da0b3578830d6a8 (diff) | |
download | mongo-eb0006626a6658963e30f6efa5f29b17db79d5f8.tar.gz |
make s3del safer
Diffstat (limited to 'buildscripts/s3del.py')
-rw-r--r-- | buildscripts/s3del.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/buildscripts/s3del.py b/buildscripts/s3del.py index 7967de62b02..c06f18e5f11 100644 --- a/buildscripts/s3del.py +++ b/buildscripts/s3del.py @@ -16,11 +16,30 @@ import subprocess def check_dir( bucket , prefix , todel ): + deleteAll = False + for ( key , modify , etag , size ) in bucket.listdir( prefix=prefix ): if key.find( todel ) < 0: continue print( key ) - time.sleep( 2 ) + + if not deleteAll: + + val = raw_input( "Delete (Y,y,n,N):" ).strip() + + if val == "n": + print( "skipping this one" ) + continue + elif val == "N": + break + + if val == "Y": + val = "y" + deleteAll = True + + if val != "y": + raise Exception( "invalid input :(" ) + bucket.delete( key ) def clean( todel ): |