From 644feaa50e6cbdc9bc8fddf2b10f8da65479eac1 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 18 Feb 2020 14:51:00 +0000 Subject: [PATCH] trivial: Fix formatting of command help texts Use the reST, Luke. Change-Id: Ie4a75c14c67a615e81ba97b60e6a5d61d2e0f764 Signed-off-by: Stephen Finucane --- osc_placement/resources/aggregate.py | 4 +- osc_placement/resources/allocation.py | 7 ++-- .../resources/allocation_candidate.py | 8 ++-- osc_placement/resources/inventory.py | 39 +++++++++---------- osc_placement/resources/resource_class.py | 17 ++++---- 5 files changed, 37 insertions(+), 38 deletions(-) diff --git a/osc_placement/resources/aggregate.py b/osc_placement/resources/aggregate.py index 0b68265..4bad1bd 100644 --- a/osc_placement/resources/aggregate.py +++ b/osc_placement/resources/aggregate.py @@ -28,7 +28,7 @@ class SetAggregate(command.Lister, version.CheckerMixin): UUID list will remove all associations with aggregates for the particular resource provider. - This command requires at least --os-placement-api-version 1.1. + This command requires at least ``--os-placement-api-version 1.1``. """ def get_parser(self, prog_name): @@ -92,7 +92,7 @@ class ListAggregate(command.Lister): """List resource provider aggregates. - This command requires at least --os-placement-api-version 1.1. + This command requires at least ``--os-placement-api-version 1.1``. """ def get_parser(self, prog_name): diff --git a/osc_placement/resources/allocation.py b/osc_placement/resources/allocation.py index 8fc01bc..f1384fe 100644 --- a/osc_placement/resources/allocation.py +++ b/osc_placement/resources/allocation.py @@ -57,7 +57,7 @@ class SetAllocation(command.Lister, version.CheckerMixin): allocations for accounting and data consistency reasons. Starting with ``--os-placement-api-version 1.12`` the API response - contains the project_id and user_id of allocations which also + contains the ``project_id`` and ``user_id`` of allocations which also appears in the CLI output. Starting with ``--os-placement-api-version 1.28`` a consumer generation is @@ -251,9 +251,8 @@ class ShowAllocation(command.Lister, version.CheckerMixin): """Show resource allocations for a given consumer. Starting with ``--os-placement-api-version 1.12`` the API response contains - the project_id and user_id of allocations which also appears in the CLI - output. - + the ``project_id`` and ``user_id`` of allocations which also appears in the + CLI output. """ def get_parser(self, prog_name): diff --git a/osc_placement/resources/allocation_candidate.py b/osc_placement/resources/allocation_candidate.py index 5a5026e..29c2a47 100644 --- a/osc_placement/resources/allocation_candidate.py +++ b/osc_placement/resources/allocation_candidate.py @@ -25,7 +25,7 @@ class ListAllocationCandidate(command.Lister, version.CheckerMixin): Returns a representation of a collection of allocation requests and resource provider summaries. Each allocation request has information - to issue an "openstack resource provider allocation set" request to claim + to issue an ``openstack resource provider allocation set`` request to claim resources against a related set of resource providers. As several allocation requests are available its necessary to select one. @@ -44,9 +44,9 @@ class ListAllocationCandidate(command.Lister, version.CheckerMixin): +---+------------+-------------------------+-------------------------+ In this case, the user is looking for resource providers that can have - capacity to allocate 1 VCPU resource class. There is one resource provider - that can serve that allocation request and that resource providers current - VCPU inventory used is 0 and available capacity is 128. + capacity to allocate 1 ``VCPU`` resource class. There is one resource + provider that can serve that allocation request and that resource providers + current ``VCPU`` inventory used is 0 and available capacity is 128. This command requires at least ``--os-placement-api-version 1.10``. """ diff --git a/osc_placement/resources/inventory.py b/osc_placement/resources/inventory.py index 20abbb0..ddb41d2 100644 --- a/osc_placement/resources/inventory.py +++ b/osc_placement/resources/inventory.py @@ -104,17 +104,18 @@ class SetInventory(command.Lister, version.CheckerMixin): Note that by default this is a full replacement of the existing inventory. If you want to retain the existing inventory and add a new resource class inventory, you must specify all resource class inventory, old and new, or - specify the --amend option. + specify the ``--amend`` option. If a specific inventory field is not specified for a given resource class, - it is assumed to be the total, i.e. --resource VCPU=16 is equivalent to - --resource VCPU:total=16. + it is assumed to be the total, i.e. ``--resource VCPU=16`` is equivalent to + ``--resource VCPU:total=16``. - Example: openstack resource provider inventory set \ - --resource VCPU=16 \ - --resource MEMORY_MB=2048 \ - --resource MEMORY_MB:step_size=128 + Example:: + openstack resource provider inventory set \ + --resource VCPU=16 \ + --resource MEMORY_MB=2048 \ + --resource MEMORY_MB:step_size=128 """ def get_parser(self, prog_name): @@ -250,14 +251,14 @@ class SetInventory(command.Lister, version.CheckerMixin): class SetClassInventory(command.ShowOne): - """Replace the inventory record of the class for the resource provider. - Example: openstack resource provider inventory class set VCPU \ - --total 16 \ - --max_unit 4 \ - --reserved 1 + Example:: + openstack resource provider inventory class set VCPU \ + --total 16 \ + --max_unit 4 \ + --reserved 1 """ def get_parser(self, prog_name): @@ -303,15 +304,13 @@ class SetClassInventory(command.ShowOne): class DeleteInventory(command.Command, version.CheckerMixin): - """Delete the inventory. - Depending on the resource class argument presence, it can - delete all inventory for a given resource provider or for a resource - provider/class pair. + Depending on the resource class argument presence, delete all inventory for + a given resource provider or for a resource provider/class pair. - Delete all inventories for given resource provider - requires at least ``--os-placement-api-version 1.5``. + Delete all inventories for given resource provider requires at least + ``--os-placement-api-version 1.5``. """ def get_parser(self, prog_name): @@ -326,8 +325,8 @@ class DeleteInventory(command.Command, version.CheckerMixin): '--resource-class', metavar='', required=self.compare_version(version.lt('1.5')), - help=(RC_HELP - + '\nThis argument can be omitted starting with ' + help=(RC_HELP + '\n' + 'This argument can be omitted starting with ' '``--os-placement-api-version 1.5``. If it is omitted all ' 'inventories of the specified resource provider ' 'will be deleted.') diff --git a/osc_placement/resources/resource_class.py b/osc_placement/resources/resource_class.py index ab04a99..e90543a 100644 --- a/osc_placement/resources/resource_class.py +++ b/osc_placement/resources/resource_class.py @@ -25,7 +25,7 @@ class ListResourceClass(command.Lister): """Return a list of all resource classes. - This command requires at least --os-placement-api-version 1.2. + This command requires at least ``--os-placement-api-version 1.2``. """ def get_parser(self, prog_name): @@ -47,7 +47,7 @@ class CreateResourceClass(command.Command): """Create a new resource class. - This command requires at least --os-placement-api-version 1.2. + This command requires at least ``--os-placement-api-version 1.2``. """ def get_parser(self, prog_name): @@ -71,8 +71,9 @@ class SetResourceClass(command.Command): """Create or validate the existence of single resource class. - Unlike "resource class create" also succeed if the resource class - already exists, which makes this an idempotent check or create command. + Unlike ``openstack resource class create``, this command also succeeds if + the resource class already exists, which makes this an idempotent check or + create command. This command requires at least ``--os-placement-api-version 1.7``. """ @@ -98,9 +99,9 @@ class SetResourceClass(command.Command): class ShowResourceClass(command.ShowOne): - """Return a representation of the resource class identified by {name}. + """Return a representation of the resource class identified by ````. - This command requires at least --os-placement-api-version 1.2. + This command requires at least ``--os-placement-api-version 1.2``. """ def get_parser(self, prog_name): @@ -126,11 +127,11 @@ class ShowResourceClass(command.ShowOne): class DeleteResourceClass(command.Command): - """Delete the resource class identified by {name}. + """Delete the resource class identified by ````. Only custom resource classes can be deleted. - This command requires at least --os-placement-api-version 1.2. + This command requires at least ``--os-placement-api-version 1.2``. """ def get_parser(self, prog_name):