From 87480ae656a8d0965d4c969099d81a1edc40e77c Mon Sep 17 00:00:00 2001 From: Tom Swanson Date: Wed, 9 Mar 2016 13:33:22 -0600 Subject: [PATCH] Dell SC: Active_backend_id wrong type Needed to convert the active_backend_id to an int for use by the Dell Storage Center API driver dell_storagecenter_api.py. Also updated the active_backend_id from the failover_host call. Change-Id: I3a0cc870057f289a5d7309f18bd29f9659ae4b25 Closes-Bug: 1555279 --- cinder/volume/drivers/dell/dell_storagecenter_api.py | 3 ++- cinder/volume/drivers/dell/dell_storagecenter_common.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cinder/volume/drivers/dell/dell_storagecenter_api.py b/cinder/volume/drivers/dell/dell_storagecenter_api.py index d883a0504..a83140035 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_api.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_api.py @@ -189,7 +189,8 @@ class StorageCenterApiHelper(object): connection.sfname = self.config.dell_sc_server_folder # Set appropriate ssn and failover state. if self.active_backend_id: - connection.ssn = self.active_backend_id + # active_backend_id is a string. Convert to int. + connection.ssn = int(self.active_backend_id) connection.failed_over = True else: diff --git a/cinder/volume/drivers/dell/dell_storagecenter_common.py b/cinder/volume/drivers/dell/dell_storagecenter_common.py index 329c7ff42..e53774d93 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_common.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_common.py @@ -1012,6 +1012,11 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD, {'ssn': destssn}) return destssn + def _update_backend(self, active_backend_id): + # Update our backend id. On the next open_connection it will use this. + self.active_backend_id = str(active_backend_id) + self._client.active_backend_id = self.active_backend_id + def failover_host(self, context, volumes, secondary_id=None): """Failover to secondary. @@ -1063,6 +1068,7 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD, 'updates': model_update}) # this is it. + self._update_backend(destssn) return destssn, volume_updates else: raise exception.InvalidInput(message=( -- 2.45.2