]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Huawei: Create snapshot have a log error
authorliuke2 <liuke2@huawei.com>
Tue, 16 Feb 2016 11:07:12 +0000 (19:07 +0800)
committerliuke2 <liuke2@huawei.com>
Wed, 2 Mar 2016 02:40:09 +0000 (10:40 +0800)
When creating snapshot, if the volume does not exist
there will be lead to a log error. This patch will
fix this.

Closes-Bug:#1545912
Change-Id:Ic99531dad4fab5e22e295e19bbfa94c7892e3ddc

cinder/volume/drivers/huawei/huawei_driver.py

index 002612bba6d14a7fd9f352d645f3ee2185ec3c62..cb3855f7292be9496b39bc80127c98cc179ca688 100644 (file)
@@ -707,8 +707,8 @@ class HuaweiBaseDriver(driver.VolumeDriver):
     def create_snapshot(self, snapshot):
         volume = snapshot.get('volume')
         if not volume:
-            msg = (_("Can't find volume id from db, volume: %(id)s") %
-                   {"id": volume['id']})
+            msg = (_("Can't get volume id from snapshot, snapshot: %(id)s")
+                   % {"id": snapshot['id']})
             LOG.error(msg)
             raise exception.VolumeBackendAPIException(data=msg)