From 8f12b620a0002325b8f90fa8c2cfe267543443df Mon Sep 17 00:00:00 2001 From: Armstrong Liu Date: Fri, 13 Dec 2019 11:43:23 +0800 Subject: [PATCH] Update revert_to_snapshot params In revert_to_snapshot method, snapshot param must be a object and also has 'id' attribute, so before use the method, we have to use snapshot.get method to get snapshot information. But revert_to_snaoshot only use id of snapshot, we can use snapshot instead of snapshot.id. Change-Id: Ifbdbae3ee66d72f9d34cf4a8fdf2bde388b2b6f0 --- cinderclient/v3/volumes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cinderclient/v3/volumes.py b/cinderclient/v3/volumes.py index 7c161bc60..fac5effce 100644 --- a/cinderclient/v3/volumes.py +++ b/cinderclient/v3/volumes.py @@ -129,11 +129,11 @@ class VolumeManager(volumes.VolumeManager): """Revert a volume to a snapshot. The snapshot must be the most recent one known to cinder. - :param volume: volume object. - :param snapshot: snapshot object. + :param volume: volume object or volume id. + :param snapshot: snapshot object or snapshot id. """ return self._action('revert', volume, - info={'snapshot_id': base.getid(snapshot.id)}) + info={'snapshot_id': base.getid(snapshot)}) @api_versions.wraps('3.12') def summary(self, all_tenants):