From fd3351ffa81d5c1aef336d789ebcf8c26b26d53c Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Tue, 2 Apr 2013 10:07:24 -0400 Subject: [PATCH] Minor typo/message fixes Correct it's -> its in force-delete message Print whole bash_completion message in "cinder help" Reformat some doc strings per PEP-0257 Change-Id: I013b849508beac5c9fe5c6f9d4cdfae54676c29c --- HACKING | 4 +-- cinderclient/shell.py | 3 ++- cinderclient/v1/shell.py | 2 +- cinderclient/v1/volumes.py | 51 +++++++++++--------------------------- cinderclient/v2/shell.py | 2 +- cinderclient/v2/volumes.py | 2 +- 6 files changed, 21 insertions(+), 43 deletions(-) diff --git a/HACKING b/HACKING index d9d1cb851..3b82d9cac 100644 --- a/HACKING +++ b/HACKING @@ -1,5 +1,5 @@ -Nova Style Commandments -======================= +Cinder Style Commandments +========================= Step 1: Read http://www.python.org/dev/peps/pep-0008/ Step 2: Read http://www.python.org/dev/peps/pep-0008/ again diff --git a/cinderclient/shell.py b/cinderclient/shell.py index c08056410..2a52685f3 100644 --- a/cinderclient/shell.py +++ b/cinderclient/shell.py @@ -446,7 +446,8 @@ class OpenStackCinderShell(object): extension.run_hooks(hook_type, *args, **kwargs) def do_bash_completion(self, args): - """ + """Print arguments for bash_completion. + Prints all of the commands and options to stdout so that the cinder.bash_completion script doesn't have to hard code them. """ diff --git a/cinderclient/v1/shell.py b/cinderclient/v1/shell.py index 8119654bf..a6f6252a8 100644 --- a/cinderclient/v1/shell.py +++ b/cinderclient/v1/shell.py @@ -256,7 +256,7 @@ def do_delete(cs, args): @utils.arg('volume', metavar='', help='ID of the volume to delete.') @utils.service_type('volume') def do_force_delete(cs, args): - """Attempt forced removal of a volume, regardless of it's state.""" + """Attempt forced removal of a volume, regardless of its state.""" volume = _find_volume(cs, args.volume) volume.force_delete() diff --git a/cinderclient/v1/volumes.py b/cinderclient/v1/volumes.py index 078cd6faa..7ab7e3c22 100644 --- a/cinderclient/v1/volumes.py +++ b/cinderclient/v1/volumes.py @@ -22,27 +22,20 @@ from cinderclient import base class Volume(base.Resource): - """ - A volume is an extra block level storage to the OpenStack instances. - """ + """A volume is an extra block level storage to the OpenStack instances.""" def __repr__(self): return "" % self.id def delete(self): - """ - Delete this volume. - """ + """Delete this volume.""" self.manager.delete(self) def update(self, **kwargs): - """ - Update the display_name or display_description for this volume. - """ + """Update the display_name or display_description for this volume.""" self.manager.update(self, **kwargs) def attach(self, instance_uuid, mountpoint): - """ - Set attachment metadata. + """Set attachment metadata. :param instance_uuid: uuid of the attaching instance. :param mountpoint: mountpoint on the attaching instance. @@ -50,54 +43,41 @@ class Volume(base.Resource): return self.manager.attach(self, instance_uuid, mountpoint) def detach(self): - """ - Clear attachment metadata. - """ + """Clear attachment metadata.""" return self.manager.detach(self) def reserve(self, volume): - """ - Reserve this volume. - """ + """Reserve this volume.""" return self.manager.reserve(self) def unreserve(self, volume): - """ - Unreserve this volume. - """ + """Unreserve this volume.""" return self.manager.unreserve(self) def begin_detaching(self, volume): - """ - Begin detaching volume. - """ + """Begin detaching volume.""" return self.manager.begin_detaching(self) def roll_detaching(self, volume): - """ - Roll detaching volume. - """ + """Roll detaching volume.""" return self.manager.roll_detaching(self) def initialize_connection(self, volume, connector): - """ - Initialize a volume connection. + """Initialize a volume connection. :param connector: connector dict from nova. """ return self.manager.initialize_connection(self, connector) def terminate_connection(self, volume, connector): - """ - Terminate a volume connection. + """Terminate a volume connection. :param connector: connector dict from nova. """ return self.manager.terminate_connection(self, connector) def set_metadata(self, volume, metadata): - """ - Set or Append metadata to a volume. + """Set or Append metadata to a volume. :param type : The :class: `Volume` to set metadata on :param metadata: A dict of key/value pairs to set @@ -106,15 +86,12 @@ class Volume(base.Resource): def upload_to_image(self, force, image_name, container_format, disk_format): - """ - Upload a volume to image service as an image. - """ + """Upload a volume to image service as an image.""" self.manager.upload_to_image(self, force, image_name, container_format, disk_format) def force_delete(self): - """ - Delete the specififed volume ignoring it's current state. + """Delete the specified volume ignoring its current state. :param volume: The UUID of the volume to force-delete. """ diff --git a/cinderclient/v2/shell.py b/cinderclient/v2/shell.py index 2cf7c768f..ee0ed23e5 100644 --- a/cinderclient/v2/shell.py +++ b/cinderclient/v2/shell.py @@ -266,7 +266,7 @@ def do_delete(cs, args): help='ID of the volume to delete.') @utils.service_type('volume') def do_force_delete(cs, args): - """Attempt forced removal of a volume, regardless of it's state.""" + """Attempt forced removal of a volume, regardless of its state.""" volume = _find_volume(cs, args.volume) volume.force_delete() diff --git a/cinderclient/v2/volumes.py b/cinderclient/v2/volumes.py index 4e9b86b77..cf9f9acf2 100644 --- a/cinderclient/v2/volumes.py +++ b/cinderclient/v2/volumes.py @@ -90,7 +90,7 @@ class Volume(base.Resource): disk_format) def force_delete(self): - """Delete the specififed volume ignoring it's current state. + """Delete the specified volume ignoring its current state. :param volume: The UUID of the volume to force-delete. """