]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add an ID to temporary volume snapshot object
authorjohn-griffith <john.griffith@solidfire.com>
Thu, 14 Feb 2013 19:00:47 +0000 (12:00 -0700)
committerjohn-griffith <john.griffith@solidfire.com>
Thu, 14 Feb 2013 19:05:19 +0000 (12:05 -0700)
The create_cloned_volum method creates a temp snapshot and
when it's done it uses the standard snapshot_delete method
in the LVM driver.

A change was added that logs a statement using the object[id],
but we weren't actually setting this on our temp object so we
would get a trace fo key DNE.  This change adds an id key to
our temp object.

Fixes bug: 1125457

Change-Id: I4d886f2738a3c394a3a3a6373045669cf6bf8aaf

cinder/volume/drivers/lvm.py

index 51df63546241465079a40530cca445a10dacfdde..44d244fc83c3df15d4b4cb57dd8cad2ca0557129 100644 (file)
@@ -252,10 +252,12 @@ class LVMVolumeDriver(driver.VolumeDriver):
         """Creates a clone of the specified volume."""
         LOG.info(_('Creating clone of volume: %s') % src_vref['id'])
         volume_name = FLAGS.volume_name_template % src_vref['id']
+        temp_id = 'tmp-snap-%s' % src_vref['id']
         temp_snapshot = {'volume_name': volume_name,
                          'size': src_vref['size'],
                          'volume_size': src_vref['size'],
-                         'name': 'clone-snap-%s' % src_vref['id']}
+                         'name': 'clone-snap-%s' % src_vref['id'],
+                         'id': temp_id}
         self.create_snapshot(temp_snapshot)
         self._create_volume(volume['name'], self._sizestr(volume['size']))
         try: