]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
3PAR drivers creating incorrect comment data
authorKurt Martin <kurt.f.martin@hp.com>
Thu, 8 Aug 2013 21:14:56 +0000 (14:14 -0700)
committerKurt Martin <kurt.f.martin@hp.com>
Thu, 8 Aug 2013 21:14:56 +0000 (14:14 -0700)
The 3PAR volumes created from a shapshot had incorrect comment data
that gets added in the comment section of the volumes on the backend.
This patch fixes the display name and description by getting the correct
data when the volume is created. This patch also fixes the inconsistency
in how the keys (name vs. display_name) were used in the comments.

Change-Id: I61af8ceb08d862f2b9dea2d9bb44c803e0b75a10
Fixes: bug 1210245
cinder/volume/drivers/san/hp/hp_3par_common.py

index 9840d52e3e6c0112ac5c037a7bf7975061672589..e6e4236a69a924a7a22e429229e35aa9306640a7 100644 (file)
@@ -899,11 +899,11 @@ exit
                 if vvs_name is None:
                     qos = self._get_qos_by_volume_type(volume_type)
 
-            name = snapshot.get('display_name', None)
+            name = volume.get('display_name', None)
             if name:
-                extra['name'] = name
+                extra['display_name'] = name
 
-            description = snapshot.get('display_description', None)
+            description = volume.get('display_description', None)
             if description:
                 extra['description'] = description
 
@@ -943,7 +943,7 @@ exit
                 extra['volume_id'] = vol_id
 
             try:
-                extra['name'] = snapshot['display_name']
+                extra['display_name'] = snapshot['display_name']
             except AttributeError:
                 pass