]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Dell SC: Active_backend_id wrong type
authorTom Swanson <tom_swanson@dell.com>
Wed, 9 Mar 2016 19:33:22 +0000 (13:33 -0600)
committerTom Swanson <tom_swanson@dell.com>
Wed, 9 Mar 2016 20:35:11 +0000 (14:35 -0600)
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
cinder/volume/drivers/dell/dell_storagecenter_common.py

index d883a05040cf47851b37ae826b926f10c62586aa..a831400353ad95c04848baf7db9592eb2d8d0360 100644 (file)
@@ -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:
 
index 329c7ff4249a92d5af668d3092e3d12b9489f2a3..e53774d93b4a440f9fc8749b38c780e2f7779228 100644 (file)
@@ -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=(