From 07e0f94043126f40715cecda1a91fa4da1983d47 Mon Sep 17 00:00:00 2001 From: Boris Pavlovic Date: Mon, 28 Aug 2017 23:32:58 -0700 Subject: [PATCH] [CLI] Introduce rally db Having 2 entrypoint seems redudant and complicated for end users, so instead of rally-manage db let's use rally db This reduces amount of code and commands needed to know to work with Rally which is actually good. This patch doesn't remove rally-manage just deprecates it Change-Id: Ib35db2d22174cd3d3eee0d87358ad07a91dce0d9 --- doc/ext/cli_reference.py | 7 +------ etc/rally.bash_completion | 7 ++++++- tests/hacking/checks.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/ext/cli_reference.py b/doc/ext/cli_reference.py index d894eac6..932c2c9d 100644 --- a/doc/ext/cli_reference.py +++ b/doc/ext/cli_reference.py @@ -20,7 +20,6 @@ from docutils.parsers import rst from rally.cli import cliutils from rally.cli import main -from rally.cli import manage import utils @@ -153,10 +152,7 @@ def get_defaults(func): def make_command_section(category_name, name, parser): - # NOTE(andreykurilin): there is only one category in rally-manage, so - # let's just hardcode it. - cmd = "rally-manage" if category_name == "db" else "rally" - section = utils.subcategory("%s %s %s" % (cmd, category_name, name)) + section = utils.subcategory("rally %s %s" % (category_name, name)) section.extend(utils.parse_text(parser["description"])) if parser["parser"].arguments: defaults = get_defaults(parser["parser"].defaults["action_fn"]) @@ -196,7 +192,6 @@ class CLIReferenceDirective(rst.Directive): def run(self): parser = Parser() categories = copy.copy(main.categories) - categories["db"] = manage.DBCommands if "group" in self.options: categories = {k: v for k, v in categories.items() if k == self.options["group"]} diff --git a/etc/rally.bash_completion b/etc/rally.bash_completion index 82ddd332..73c506a6 100644 --- a/etc/rally.bash_completion +++ b/etc/rally.bash_completion @@ -18,6 +18,11 @@ _rally() declare -A SUBCOMMANDS declare -A OPTS + OPTS["db_create"]="" + OPTS["db_recreate"]="" + OPTS["db_revision"]="" + OPTS["db_show"]="" + OPTS["db_upgrade"]="" OPTS["deployment_check"]="--deployment" OPTS["deployment_config"]="--deployment" OPTS["deployment_create"]="--name --fromenv --filename --no-use" @@ -91,4 +96,4 @@ _rally() return 0 } -complete -o filenames -F _rally rally +complete -o filenames -F _rally rally \ No newline at end of file diff --git a/tests/hacking/checks.py b/tests/hacking/checks.py index f97c5e92..71bbc189 100644 --- a/tests/hacking/checks.py +++ b/tests/hacking/checks.py @@ -558,7 +558,7 @@ def check_db_imports_in_cli(logical_line, physical_line, filename): N360 """ if (not filename.startswith("./rally/cli") - or filename == "./rally/cli/manage.py"): + or filename == "./rally/cli/commands/db.py"): return if re_db_import.search(logical_line): yield (0, "N360 CLI modules do not allow to work with "