diff options
author | Ionuț Arțăriși <iartarisi@suse.cz> | 2014-02-13 11:26:56 +0100 |
---|---|---|
committer | Ionuț Arțăriși <iartarisi@suse.cz> | 2014-03-10 10:16:03 +0100 |
commit | a5d745dd8717de4d86a76f95cf8f5800246c911a (patch) | |
tree | 96dd217c4abcb64b7c048610ae026fddc98f0cca | |
parent | 8f200b73719b36a7ab2f8d651e46a8b6b55c9a77 (diff) | |
download | trove-a5d745dd8717de4d86a76f95cf8f5800246c911a.tar.gz |
rename and fix the db_wipe command
* rename db_wipe to db_recreate
* make --repo-path an optional argument for db_wipe and use it
* add command line help strings for db_wipe
Closes-Bug: #1279734
Change-Id: I1a1d3ad56989026fb10f6c57bb479814dc51328e
-rw-r--r-- | doc/source/dev/manual_install.rst | 2 | ||||
-rwxr-xr-x | tools/start-fake-mode.sh | 2 | ||||
-rwxr-xr-x | trove/cmd/manage.py | 10 |
3 files changed, 9 insertions, 5 deletions
diff --git a/doc/source/dev/manual_install.rst b/doc/source/dev/manual_install.rst index 5f57bf7d..19296e77 100644 --- a/doc/source/dev/manual_install.rst +++ b/doc/source/dev/manual_install.rst @@ -212,7 +212,7 @@ Prepare database ---------------- * Initialize the database:: - # trove-manage --config-file=<PathToTroveConf> db_wipe trove_test.sqlite mysql fake + # trove-manage --config-file=<PathToTroveConf> db_recreate trove_test.sqlite mysql fake * Setup trove to use the uploaded image. Enter the following in a single line, note quotes (') and backquotes(`):: diff --git a/tools/start-fake-mode.sh b/tools/start-fake-mode.sh index a4fbf952..761964a7 100755 --- a/tools/start-fake-mode.sh +++ b/tools/start-fake-mode.sh @@ -10,7 +10,7 @@ function run() { .tox/py26/bin/python $@ } run bin/trove-manage \ - --config-file=etc/trove/trove.conf.test db_wipe \ + --config-file=etc/trove/trove.conf.test db_recreate \ trove_test.sqlite mysql fake run bin/trove-fake-mode \ --fork --config-file=etc/trove/trove.conf.test \ diff --git a/trove/cmd/manage.py b/trove/cmd/manage.py index bfe684f6..986a382b 100755 --- a/trove/cmd/manage.py +++ b/trove/cmd/manage.py @@ -77,10 +77,10 @@ class Commands(object): except exception.DatastoreNotFound as e: print(e) - def db_wipe(self, repo_path): + def db_recreate(self, repo_path): """Drops the database and recreates it.""" self.db_api.drop_db(CONF) - self.db_sync() + self.db_sync(repo_path) def params_of(self, command_name): if Commands.has(command_name): @@ -113,7 +113,11 @@ def main(): parser.add_argument('packages') parser.add_argument('active') - parser = subparser.add_parser('db_wipe') + parser = subparser.add_parser( + 'db_recreate', description='Drop the database and recreate it') + parser.add_argument( + '--repo_path', help='SQLAlchemy Migrate repository path') + parser = subparser.add_parser('db_recreate') parser.add_argument('repo_path') cfg.custom_parser('action', actions) |