aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Kramer <jakob.kramer@gmx.de>2012-03-24 15:33:36 +0100
committerJakob Kramer <jakob.kramer@gmx.de>2012-03-24 15:33:36 +0100
commit9edd71ebf7c348e62573b2a939a87c6702f57cd0 (patch)
tree883d6e8713efbe1bf880a9bc8b3bd425fa74ffb8
parent32d8cf45114634d7d862db8b6255e07a1b94ffde (diff)
downloadmediagoblin-9edd71ebf7c348e62573b2a939a87c6702f57cd0.tar.lz
mediagoblin-9edd71ebf7c348e62573b2a939a87c6702f57cd0.tar.xz
mediagoblin-9edd71ebf7c348e62573b2a939a87c6702f57cd0.zip
Wipe the configured database, not the default one
-rw-r--r--mediagoblin/gmg_commands/wipealldata.py8
1 files changed, 6 insertions, 2 deletions
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")]: