From 5fb6f5c76bf72b8e950a68cfe5159b04a5da166f Mon Sep 17 00:00:00 2001 From: Swapnil Kulkarni Date: Wed, 13 May 2015 11:31:45 +0000 Subject: [PATCH] Fixed typos and repeated docstrings Updates in [1] volume_snapshots.py (v1 & v2) [2] qos_specs.py (v1 & v2) [3] volumes.py Closes-Bug: #1343844 Co-Authored-By: Chandan Kumar Change-Id: I867a9eae6e1907b941e49928c6aa976d261d159a --- cinderclient/v1/qos_specs.py | 4 ++-- cinderclient/v1/volume_snapshots.py | 2 +- cinderclient/v2/qos_specs.py | 4 ++-- cinderclient/v2/volume_snapshots.py | 1 - cinderclient/v2/volumes.py | 16 +++++++++++----- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/cinderclient/v1/qos_specs.py b/cinderclient/v1/qos_specs.py index b4e4272ae..c7944cb48 100644 --- a/cinderclient/v1/qos_specs.py +++ b/cinderclient/v1/qos_specs.py @@ -86,7 +86,7 @@ class QoSSpecsManager(base.ManagerWithFind): return self._create("/qos-specs", body, "qos_specs") def set_keys(self, qos_specs, specs): - """Update a qos specs with new specifications. + """Add/Update keys in a qos_specs. :param qos_specs: The ID of qos specs :param specs: A dict of key/value pairs to be set @@ -101,7 +101,7 @@ class QoSSpecsManager(base.ManagerWithFind): return self._update("/qos-specs/%s" % qos_specs, body) def unset_keys(self, qos_specs, specs): - """Update a qos specs with new specifications. + """Remove keys from a qos specs. :param qos_specs: The ID of qos specs :param specs: A list of key to be unset diff --git a/cinderclient/v1/volume_snapshots.py b/cinderclient/v1/volume_snapshots.py index 690fd0123..4b4ce6086 100644 --- a/cinderclient/v1/volume_snapshots.py +++ b/cinderclient/v1/volume_snapshots.py @@ -54,7 +54,7 @@ class Snapshot(base.Resource): return self._info.get('os-extended-snapshot-attributes:project_id') def reset_state(self, state): - """Update the snapshot with the privided state.""" + """Update the snapshot with the provided state.""" self.manager.reset_state(self, state) def set_metadata(self, metadata): diff --git a/cinderclient/v2/qos_specs.py b/cinderclient/v2/qos_specs.py index b4e4272ae..948fc0648 100644 --- a/cinderclient/v2/qos_specs.py +++ b/cinderclient/v2/qos_specs.py @@ -86,7 +86,7 @@ class QoSSpecsManager(base.ManagerWithFind): return self._create("/qos-specs", body, "qos_specs") def set_keys(self, qos_specs, specs): - """Update a qos specs with new specifications. + """Add/Update keys in qos specs. :param qos_specs: The ID of qos specs :param specs: A dict of key/value pairs to be set @@ -101,7 +101,7 @@ class QoSSpecsManager(base.ManagerWithFind): return self._update("/qos-specs/%s" % qos_specs, body) def unset_keys(self, qos_specs, specs): - """Update a qos specs with new specifications. + """Remove keys from a qos specs. :param qos_specs: The ID of qos specs :param specs: A list of key to be unset diff --git a/cinderclient/v2/volume_snapshots.py b/cinderclient/v2/volume_snapshots.py index 51b611db6..0949f70c0 100644 --- a/cinderclient/v2/volume_snapshots.py +++ b/cinderclient/v2/volume_snapshots.py @@ -105,7 +105,6 @@ class SnapshotManager(base.ManagerWithFind): :rtype: list of :class:`Snapshot` """ - if search_opts is None: search_opts = {} diff --git a/cinderclient/v2/volumes.py b/cinderclient/v2/volumes.py index 7fc126755..d28047202 100644 --- a/cinderclient/v2/volumes.py +++ b/cinderclient/v2/volumes.py @@ -112,10 +112,10 @@ class Volume(base.Resource): def extend(self, volume, new_size): """Extend the size of the specified volume. + :param volume: The UUID of the volume to extend :param new_size: The desired size to extend volume to. """ - self.manager.extend(self, new_size) def migrate_volume(self, host, force_host_copy): @@ -193,8 +193,7 @@ class VolumeManager(base.ManagerWithFind): :param scheduler_hints: (optional extension) arbitrary key-value pairs specified by the client to help boot an instance :rtype: :class:`Volume` - """ - + """ if metadata is None: volume_metadata = {} else: @@ -420,6 +419,10 @@ class VolumeManager(base.ManagerWithFind): 'disk_format': disk_format}) def force_delete(self, volume): + """Delete the specified volume ignoring its current state. + + :param volume: The :class:`Volume` to force-delete. + """ return self._action('os-force_delete', base.getid(volume)) def reset_state(self, volume, state): @@ -427,6 +430,11 @@ class VolumeManager(base.ManagerWithFind): return self._action('os-reset_status', volume, {'status': state}) def extend(self, volume, new_size): + """Extend the size of the specified volume. + + :param volume: The UUID of the volume to extend. + :param new_size: The requested size to extend volume to. + """ return self._action('os-extend', base.getid(volume), {'new_size': new_size}) @@ -447,7 +455,6 @@ class VolumeManager(base.ManagerWithFind): :param host: The destination host :param force_host_copy: Skip driver optimizations """ - return self._action('os-migrate_volume', volume, {'host': host, 'force_host_copy': force_host_copy}) @@ -459,7 +466,6 @@ class VolumeManager(base.ManagerWithFind): :param new_volume: The new temporary :class:`Volume` in the migration :param error: Inform of an error to cause migration cleanup """ - new_volume_id = base.getid(new_volume) return self._action('os-migrate_volume_completion', old_volume,