From 891722fe371b3c518b9dd04c21672202088d49a8 Mon Sep 17 00:00:00 2001 From: Kurt Martin Date: Mon, 8 Jun 2015 10:26:20 -0700 Subject: [PATCH] Fixes 3PAR snapshot failure with optional params 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cinder/volume/drivers/san/hp/hp_3par_common.py b/cinder/volume/drivers/san/hp/hp_3par_common.py index 98fc649f7..ff52768d5 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_common.py +++ b/cinder/volume/drivers/san/hp/hp_3par_common.py @@ -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: -- 2.45.2