Merge "Minor typo/message fixes"

This commit is contained in:
Jenkins
2013-04-09 15:26:12 +00:00
committed by Gerrit Code Review
6 changed files with 21 additions and 43 deletions

View File

@@ -1,5 +1,5 @@
Nova Style Commandments Cinder Style Commandments
======================= =========================
Step 1: Read http://www.python.org/dev/peps/pep-0008/ Step 1: Read http://www.python.org/dev/peps/pep-0008/
Step 2: Read http://www.python.org/dev/peps/pep-0008/ again Step 2: Read http://www.python.org/dev/peps/pep-0008/ again

View File

@@ -456,7 +456,8 @@ class OpenStackCinderShell(object):
extension.run_hooks(hook_type, *args, **kwargs) extension.run_hooks(hook_type, *args, **kwargs)
def do_bash_completion(self, args): def do_bash_completion(self, args):
""" """Print arguments for bash_completion.
Prints all of the commands and options to stdout so that the Prints all of the commands and options to stdout so that the
cinder.bash_completion script doesn't have to hard code them. cinder.bash_completion script doesn't have to hard code them.
""" """

View File

@@ -256,7 +256,7 @@ def do_delete(cs, args):
@utils.arg('volume', metavar='<volume>', help='ID of the volume to delete.') @utils.arg('volume', metavar='<volume>', help='ID of the volume to delete.')
@utils.service_type('volume') @utils.service_type('volume')
def do_force_delete(cs, args): 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 = _find_volume(cs, args.volume)
volume.force_delete() volume.force_delete()

View File

@@ -22,27 +22,20 @@ from cinderclient import base
class Volume(base.Resource): 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): def __repr__(self):
return "<Volume: %s>" % self.id return "<Volume: %s>" % self.id
def delete(self): def delete(self):
""" """Delete this volume."""
Delete this volume.
"""
self.manager.delete(self) self.manager.delete(self)
def update(self, **kwargs): 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) self.manager.update(self, **kwargs)
def attach(self, instance_uuid, mountpoint): def attach(self, instance_uuid, mountpoint):
""" """Set attachment metadata.
Set attachment metadata.
:param instance_uuid: uuid of the attaching instance. :param instance_uuid: uuid of the attaching instance.
:param mountpoint: mountpoint on 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) return self.manager.attach(self, instance_uuid, mountpoint)
def detach(self): def detach(self):
""" """Clear attachment metadata."""
Clear attachment metadata.
"""
return self.manager.detach(self) return self.manager.detach(self)
def reserve(self, volume): def reserve(self, volume):
""" """Reserve this volume."""
Reserve this volume.
"""
return self.manager.reserve(self) return self.manager.reserve(self)
def unreserve(self, volume): def unreserve(self, volume):
""" """Unreserve this volume."""
Unreserve this volume.
"""
return self.manager.unreserve(self) return self.manager.unreserve(self)
def begin_detaching(self, volume): def begin_detaching(self, volume):
""" """Begin detaching volume."""
Begin detaching volume.
"""
return self.manager.begin_detaching(self) return self.manager.begin_detaching(self)
def roll_detaching(self, volume): def roll_detaching(self, volume):
""" """Roll detaching volume."""
Roll detaching volume.
"""
return self.manager.roll_detaching(self) return self.manager.roll_detaching(self)
def initialize_connection(self, volume, connector): def initialize_connection(self, volume, connector):
""" """Initialize a volume connection.
Initialize a volume connection.
:param connector: connector dict from nova. :param connector: connector dict from nova.
""" """
return self.manager.initialize_connection(self, connector) return self.manager.initialize_connection(self, connector)
def terminate_connection(self, volume, connector): def terminate_connection(self, volume, connector):
""" """Terminate a volume connection.
Terminate a volume connection.
:param connector: connector dict from nova. :param connector: connector dict from nova.
""" """
return self.manager.terminate_connection(self, connector) return self.manager.terminate_connection(self, connector)
def set_metadata(self, volume, metadata): 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 type : The :class: `Volume` to set metadata on
:param metadata: A dict of key/value pairs to set :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, def upload_to_image(self, force, image_name, container_format,
disk_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, self.manager.upload_to_image(self, force, image_name, container_format,
disk_format) disk_format)
def force_delete(self): def force_delete(self):
""" """Delete the specified volume ignoring its current state.
Delete the specififed volume ignoring it's current state.
:param volume: The UUID of the volume to force-delete. :param volume: The UUID of the volume to force-delete.
""" """

View File

@@ -266,7 +266,7 @@ def do_delete(cs, args):
help='ID of the volume to delete.') help='ID of the volume to delete.')
@utils.service_type('volume') @utils.service_type('volume')
def do_force_delete(cs, args): 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 = _find_volume(cs, args.volume)
volume.force_delete() volume.force_delete()

View File

@@ -90,7 +90,7 @@ class Volume(base.Resource):
disk_format) disk_format)
def force_delete(self): 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. :param volume: The UUID of the volume to force-delete.
""" """