]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fixes call VolumeNotFound in the invalid argument
authorKIYOHIRO ADACHI <adachi@mxs.nes.nec.co.jp>
Tue, 17 Sep 2013 07:08:55 +0000 (16:08 +0900)
committerKIYOHIRO ADACHI <adachi@mxs.nes.nec.co.jp>
Wed, 18 Sep 2013 08:01:51 +0000 (17:01 +0900)
A mapping key of 'volume_id' is ignored when we use the non keyword
argument. Thus information in 'volume_id' is lost.  Similarly, in the
case of exception.SnapshotNotFound, information in 'snapshot_id' is
lost.

Change-Id: I1a704cc1866ad9b0d9578e16e77c376a77ea5b3e
Closes-Bug: #1226442

cinder/volume/drivers/storwize_svc.py

index 581627a05309a9ec07683dff2b782433bac23639..d92ef6d5ec7610b77d4da4d7044019ae61c01b45 100644 (file)
@@ -1162,15 +1162,14 @@ class StorwizeSVCDriver(san.SanDriver):
         src_vdisk_attributes = self._get_vdisk_attributes(src_vdisk)
         if src_vdisk_attributes is None:
             exception_msg = (
-                _('_create_copy: Source vdisk %s does not exist')
-                % src_vdisk)
+                _('_create_copy: Source vdisk %(src_vdisk)s (%(src_id)s) '
+                  'does not exist')
+                % {'src_vdisk': src_vdisk, 'src_id': src_id})
             LOG.error(exception_msg)
             if from_vol:
-                raise exception.VolumeNotFound(exception_msg,
-                                               volume_id=src_id)
+                raise exception.VolumeNotFound(volume_id=src_id)
             else:
-                raise exception.SnapshotNotFound(exception_msg,
-                                                 snapshot_id=src_id)
+                raise exception.SnapshotNotFound(snapshot_id=src_id)
 
         self._driver_assert(
             'capacity' in src_vdisk_attributes,