]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fixes 3PAR snapshot failure with optional params
authorKurt Martin <kurt.f.martin@hp.com>
Mon, 8 Jun 2015 17:26:20 +0000 (10:26 -0700)
committerKurt Martin <kurt.f.martin@hp.com>
Mon, 8 Jun 2015 17:26:20 +0000 (10:26 -0700)
Create snapshot fails when HP3PAR hp3par_snapshot_retention and/or
hp3par_snapshot_expiration parameters were set in cinder.conf. The
params were being sent to the backend as strings instead on integers.

Change-Id: I24d0bc133c48b47a27f5c112e9cd924dd0fa3bcc
Closes-bug: #1461640

cinder/volume/drivers/san/hp/hp_3par_common.py

index 98fc649f7a82790dd1a2fce0a2026d758c64e2e9..ff52768d5c0603de1a96017569642229ec2719af 100644 (file)
@@ -174,10 +174,11 @@ class HP3PARCommon(object):
         2.0.39 - Added support for updated detach_volume attachment.
         2.0.40 - Make the 3PAR drivers honor the pool in create  bug #1432876
         2.0.41 - Only log versions at startup.  bug #1447697
+        2.0.42 - Fix type for snapshot config settings. bug #1461640
 
     """
 
-    VERSION = "2.0.41"
+    VERSION = "2.0.42"
 
     stats = {}
 
@@ -1495,11 +1496,11 @@ class HP3PARCommon(object):
                         'readOnly': True}
             if self.config.hp3par_snapshot_expiration:
                 optional['expirationHours'] = (
-                    self.config.hp3par_snapshot_expiration)
+                    int(self.config.hp3par_snapshot_expiration))
 
             if self.config.hp3par_snapshot_retention:
                 optional['retentionHours'] = (
-                    self.config.hp3par_snapshot_retention)
+                    int(self.config.hp3par_snapshot_retention))
 
             self.client.createSnapshot(snap_name, vol_name, optional)
         except hpexceptions.HTTPForbidden as ex: