From cd6c285cc6c2274e6b42cc452ba4a61a3487ca23 Mon Sep 17 00:00:00 2001 From: Eric Fried Date: Mon, 28 Oct 2019 17:27:38 -0500 Subject: neutron: autogenerate docs $namespace = openstack.network.v2 The subcommand documents for $namespace were hardcoded and thus prone to drift over time. This commit removes the hardcoded content and uses the autoprogram-cliff directive to generate them automatically from the subcommand configuration classes. This one turned out to be quite involved, because we support both neutron and nova-network. When running in a real cloud, the command classes detect whether the neutron service is present, assume nova-network if that service is not found, and only add parser options relevant to the detected service. But the docs need to present both sets of options. This was easy enough when they were hardcoded, but required a bit of additional infrastructure for generated docs. Change-Id: I426261eb1d86bcc68656aabd61f10b7f082da402 --- openstackclient/identity/common.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'openstackclient/identity') diff --git a/openstackclient/identity/common.py b/openstackclient/identity/common.py index d125d285..7be2a17b 100644 --- a/openstackclient/identity/common.py +++ b/openstackclient/identity/common.py @@ -233,13 +233,13 @@ def add_group_domain_option_to_parser(parser): ) -def add_project_domain_option_to_parser(parser): +def add_project_domain_option_to_parser(parser, enhance_help=lambda _h: _h): parser.add_argument( '--project-domain', metavar='', - help=_('Domain the project belongs to (name or ID). ' - 'This can be used in case collisions between project names ' - 'exist.'), + help=enhance_help(_('Domain the project belongs to (name or ID). This ' + 'can be used in case collisions between project ' + 'names exist.')), ) -- cgit v1.2.1