Skip to content

Instantly share code, notes, and snippets.

@vishvananda
Created February 8, 2012 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishvananda/1763312 to your computer and use it in GitHub Desktop.
Save vishvananda/1763312 to your computer and use it in GitHub Desktop.
diff --git a/nova/api/openstack/compute/contrib/volumes.py b/nova/api/openstack/compute/contrib/volumes.py
index 6d01100..e235ad0 100644
--- a/nova/api/openstack/compute/contrib/volumes.py
+++ b/nova/api/openstack/compute/contrib/volumes.py
@@ -517,18 +517,20 @@ class SnapshotController(object):
snapshot = body['snapshot']
volume_id = snapshot['volume_id']
+ volume = self.volume_api.get(context, volume_id)
+
force = snapshot.get('force', False)
LOG.audit(_("Create snapshot from volume %s"), volume_id,
context=context)
if force:
new_snapshot = self.volume_api.create_snapshot_force(context,
- volume_id,
+ volume,
snapshot.get('display_name'),
snapshot.get('display_description'))
else:
new_snapshot = self.volume_api.create_snapshot(context,
- volume_id,
+ volume,
snapshot.get('display_name'),
snapshot.get('display_description'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment