From 5ead630429c2638a6bdb40f50567af2e233dabd5 Mon Sep 17 00:00:00 2001 From: Xing Zhang Date: Fri, 12 Apr 2019 12:15:07 +0800 Subject: [PATCH] Fix cinder-manage args --max_count in docs --max_count was added in [0] [0] https://review.openstack.org/#/c/330391/ Change-Id: If3780b4ec799ff244f02182b636a7afe4037445b --- cinder/cmd/manage.py | 2 +- cinder/tests/unit/test_cmd.py | 2 +- doc/source/cli/cinder-manage.rst | 6 +++--- doc/source/upgrade.rst | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cinder/cmd/manage.py b/cinder/cmd/manage.py index ea25d0e5e58..4ea33f1cced 100644 --- a/cinder/cmd/manage.py +++ b/cinder/cmd/manage.py @@ -381,7 +381,7 @@ class DbCommands(object): if max_count is not None: unlimited = False if max_count < 1: - print(_('Must supply a positive value for max_number.')) + print(_('Must supply a positive value for max_count.')) sys.exit(127) else: unlimited = True diff --git a/cinder/tests/unit/test_cmd.py b/cinder/tests/unit/test_cmd.py index c658aeab730..bfff325876c 100644 --- a/cinder/tests/unit/test_cmd.py +++ b/cinder/tests/unit/test_cmd.py @@ -503,7 +503,7 @@ Running batches of 50 until complete. command.online_data_migrations, max_count=50) self.assertEqual(2, exit.code) - # When --max-count is not used, we should get 2 if all possible + # When --max_count is not used, we should get 2 if all possible # migrations completed but some raise exceptions good_remaining = [50] exit = self.assertRaises(SystemExit, diff --git a/doc/source/cli/cinder-manage.rst b/doc/source/cli/cinder-manage.rst index f07872faf4c..458fe67f0b4 100644 --- a/doc/source/cli/cinder-manage.rst +++ b/doc/source/cli/cinder-manage.rst @@ -73,7 +73,7 @@ version Database version Purge database entries that are marked as deleted, that are older than the number of days specified. -``cinder-manage db online_data_migrations [--max-count ]`` +``cinder-manage db online_data_migrations [--max_count ]`` Perform online data migrations for database upgrade between releases in batches. @@ -82,12 +82,12 @@ This command interprets the following options when it is invoked: .. code-block:: console - --max-count Maximum number of objects to migrate. If not specified, all + --max_count Maximum number of objects to migrate. If not specified, all possible migrations will be completed, in batches of 50 at a time. Returns exit status 0 if no (further) updates are possible, 1 if the -``--max-count`` option was used and some updates were completed successfully +``--max_count`` option was used and some updates were completed successfully (even if others generated errors), 2 if some updates generated errors and no other migrations were able to take effect in the last batch attempted, or 127 if invalid input is provided (e.g. non-numeric max-count). diff --git a/doc/source/upgrade.rst b/doc/source/upgrade.rst index 1d93e5496e2..71e7289af5f 100644 --- a/doc/source/upgrade.rst +++ b/doc/source/upgrade.rst @@ -239,7 +239,7 @@ After maintenance window * Since Ocata, you also need to run ``cinder-manage db online_data_migrations`` command to make sure data migrations are applied. The tool lets you limit - the impact of the data migrations by using ``--max-count`` option to limit + the impact of the data migrations by using ``--max_count`` option to limit number of migrations executed in one run. If this option is used, the exit status will be 1 if any migrations were successful (even if others generated errors, which could be due to dependencies between migrations).