]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add more logging to migrate_volume_completion
authorAvishay Traeger <avishay@il.ibm.com>
Tue, 3 Dec 2013 08:47:33 +0000 (10:47 +0200)
committerAvishay Traeger <avishay@il.ibm.com>
Tue, 3 Dec 2013 09:50:41 +0000 (11:50 +0200)
Add a debug message on entering the function, and an info message if
it was called to clean up an error. This is useful because Nova copies
the data of in-use volumes, and if it fails there will only be a
message in the Nova logs.

Change-Id: I546d0bae8639072727ebe23394885d40255ba1d4

cinder/volume/manager.py

index fcfd80dc82b897121ddf7e7a4abc0c7516044518..97e4e61ac6384f219d76d5ee4e9ebf4e9f22b6d1 100644 (file)
@@ -731,11 +731,18 @@ class VolumeManager(manager.SchedulerDependentManager):
 
     def migrate_volume_completion(self, ctxt, volume_id, new_volume_id,
                                   error=False):
+        msg = _("migrate_volume_completion: completing migration for "
+                "volume %(vol1)s (temporary volume %(vol2)s")
+        LOG.debug(msg % {'vol1': volume_id, 'vol2': new_volume_id})
         volume = self.db.volume_get(ctxt, volume_id)
         new_volume = self.db.volume_get(ctxt, new_volume_id)
         rpcapi = volume_rpcapi.VolumeAPI()
 
         if error:
+            msg = _("migrate_volume_completion is cleaning up an error "
+                    "for volume %(vol1)s (temporary volume %(vol2)s")
+            LOG.info(msg % {'vol1': volume['id'],
+                            'vol2': new_volume['id']})
             new_volume['migration_status'] = None
             rpcapi.delete_volume(ctxt, new_volume)
             self.db.volume_update(ctxt, volume_id, {'migration_status': None})