From 20139677b35f3580097891c1c2ea63cb31f1de76 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sat, 13 Sep 2014 21:51:43 +0200 Subject: [PATCH] Document cinderclient v2 as well Document cinder v2 commands as well. Partial-Bug: #1369149 Change-Id: I9ba1c4d47dcb71bfb003779c5bc765ba6348d9c8 --- RELEASE_NOTES.rst | 2 +- os_doc_tools/commands.py | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index dfcf5c25..7119d09b 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -16,7 +16,7 @@ Release notes * Provide a ``hotref`` extension for sphinx, to automate the creation of references to the HOT resources documentation. * ``openstack-auto-commands``: Handle python-openstackclient, handle - python-glanceclient v2 commands. + python-glanceclient and python-cinderclient v2 commands. 0.18.1 ------ diff --git a/os_doc_tools/commands.py b/os_doc_tools/commands.py index 817e313b..94abdb5b 100644 --- a/os_doc_tools/commands.py +++ b/os_doc_tools/commands.py @@ -460,8 +460,11 @@ def generate_subcommands(os_command, os_file, blacklist, only_subcommands, blacklist.append("complete") blacklist.append("help") if not only_subcommands: - all_options = check_output([os_command, - "bash-completion"]).strip().split() + args = [os_command] + if extra_params: + args.extend(extra_params) + args.append("bash-completion") + all_options = check_output(args).strip().split() else: all_options = only_subcommands @@ -579,6 +582,10 @@ def document_single_project(os_command, output_dir): generate_heading(os_command, api_name, title, out_file) generate_command(os_command, out_file) + if os_command == 'cinder': + out_file.write(""" +
+ Block Storage API v1 commands\n""") if os_command == 'glance': out_file.write("""
@@ -587,6 +594,23 @@ def document_single_project(os_command, output_dir): generate_subcommands(os_command, out_file, blacklist, subcommands, None, "", "") + if os_command == 'cinder': + out_file.write("
\n") + out_file.write(""" +
+ Block Storage API v2 commands + + You can select an API version to use by adding the + --os-volume-api-version option or by setting + the corresponding environment variable:\n""") + out_file.write("$ " + "export OS_VOLUME_API_VERSION=2\n" + "\n") + + generate_subcommands(os_command, out_file, blacklist, + subcommands, ["--os-volume-api-version", "2"], + "_v2", " (v2)") + out_file.write("
\n") if os_command == 'glance': out_file.write("
\n") subcommands = ['explain', 'image-create', 'image-delete',