From: Jakob Kramer Date: Sat, 24 Mar 2012 14:33:36 +0000 (+0100) Subject: Wipe the configured database, not the default one X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9edd71ebf7c348e62573b2a939a87c6702f57cd0;p=mediagoblin.git Wipe the configured database, not the default one --- diff --git a/mediagoblin/gmg_commands/wipealldata.py b/mediagoblin/gmg_commands/wipealldata.py index 3081bbc0..37217fd1 100644 --- a/mediagoblin/gmg_commands/wipealldata.py +++ b/mediagoblin/gmg_commands/wipealldata.py @@ -20,12 +20,16 @@ import sys import os import shutil +from mediagoblin.init import setup_global_and_app_config + def wipe_parser_setup(subparser): pass def wipe(args): + global_config, app_config = setup_global_and_app_config(args.conf_file) + print "*** WARNING! ***" print "" print "Running this will destroy your mediagoblin database," @@ -39,12 +43,12 @@ def wipe(args): 'Are you **SURE** you want to destroy your environment? ' '(if so, type "yes")> ') - if not drop_it == 'yes': + if drop_it != 'yes': return print "nixing data in mongodb...." conn = pymongo.Connection() - conn.drop_database('mediagoblin') + conn.drop_database(app_config["db_name"]) for directory in [os.path.join(os.getcwd(), "user_dev", "media"), os.path.join(os.getcwd(), "user_dev", "beaker")]: