From f02d3fc71385a665bbdb0a81b7aff968fd56aacd Mon Sep 17 00:00:00 2001 From: Lin Yang Date: Mon, 27 Nov 2017 11:39:38 -0800 Subject: [PATCH] Add comment for each OSC subcommand OSC will automatically use subcommands comments to generate usage doc. So added one line comments for each one as other client project does. Change-Id: I5799f3fb989af7855634c3c1fc994e24b1add533 --- rsdclient/osc/v1/fabric.py | 4 ++++ rsdclient/osc/v1/node.py | 24 ++++++++++++++++++------ rsdclient/osc/v1/storage_service.py | 6 +++++- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/rsdclient/osc/v1/fabric.py b/rsdclient/osc/v1/fabric.py index 71f786a..fbc31b3 100644 --- a/rsdclient/osc/v1/fabric.py +++ b/rsdclient/osc/v1/fabric.py @@ -19,6 +19,8 @@ from rsdclient.common import command class ListFabric(command.Command): + """List all fabrics.""" + _description = "List all Fabrics" def take_action(self, parsed_args): @@ -29,6 +31,8 @@ class ListFabric(command.Command): class ShowFabric(command.Command): + """Show fabric details.""" + _description = "Display fabric details" def get_parser(self, prog_name): diff --git a/rsdclient/osc/v1/node.py b/rsdclient/osc/v1/node.py index 1f77649..d2fada1 100644 --- a/rsdclient/osc/v1/node.py +++ b/rsdclient/osc/v1/node.py @@ -30,7 +30,9 @@ ARGUMENTS_NAME_MAPPING = { class ComposeNode(command.Command): - _description = "Compose a Node" + """Compose a node.""" + + _description = "Compose a node" def get_parser(self, prog_name): parser = super(ComposeNode, self).get_parser(prog_name) @@ -236,7 +238,9 @@ class ComposeNode(command.Command): class DeleteNode(command.Command): - _description = "Delete a Node" + """Delete a node.""" + + _description = "Delete a node" def get_parser(self, prog_name): parser = super(DeleteNode, self).get_parser(prog_name) @@ -257,7 +261,9 @@ class DeleteNode(command.Command): class ShowNode(command.Command): - _description = "Display node details" + """Show node details.""" + + _description = "Show node details" def get_parser(self, prog_name): parser = super(ShowNode, self).get_parser(prog_name) @@ -276,7 +282,9 @@ class ShowNode(command.Command): class ListNode(command.Command): - _description = "List all composed nodes" + """List all nodes.""" + + _description = "List all nodes" def take_action(self, parsed_args): self.log.debug("take_action(%s)", parsed_args) @@ -286,7 +294,9 @@ class ListNode(command.Command): class AttachEndpoint(command.Command): - _description = "Attach drive to existing composed node" + """Attach drive to existing node.""" + + _description = "Attach drive to existing node" def get_parser(self, prog_name): parser = super(AttachEndpoint, self).get_parser(prog_name) @@ -313,7 +323,9 @@ class AttachEndpoint(command.Command): class DetachEndpoint(command.Command): - _description = "Detach drive from a composed node" + """Detach drive from existing node.""" + + _description = "Detach drive from existing node" def get_parser(self, prog_name): parser = super(DetachEndpoint, self).get_parser(prog_name) diff --git a/rsdclient/osc/v1/storage_service.py b/rsdclient/osc/v1/storage_service.py index 10d079f..9aa4a7f 100644 --- a/rsdclient/osc/v1/storage_service.py +++ b/rsdclient/osc/v1/storage_service.py @@ -19,6 +19,8 @@ from rsdclient.common import command class ListStorageServices(command.Command): + """List all storage services.""" + _description = "List all storage services" def take_action(self, parsed_args): @@ -29,7 +31,9 @@ class ListStorageServices(command.Command): class ShowStorageServices(command.Command): - _description = "Display storage service details" + """Show storage service details""" + + _description = "Show storage service details" def get_parser(self, prog_name): parser = super(ShowStorageServices, self).get_parser(prog_name)