]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Dell Storage Center API change fails init_conn
authorTom Swanson <tom_swanson@dell.com>
Tue, 24 Mar 2015 17:57:22 +0000 (12:57 -0500)
committerTom Swanson <tom_swanson@dell.com>
Tue, 24 Mar 2015 18:46:39 +0000 (13:46 -0500)
An attribute in the dell storage center REST API containing
the world wide name of the target device changed.  This meant
that on intialize connection we were returning None instead of
the wwn.

The driver has been changed to look for the new attribute and
to fall back to the old.  If neither is found it will not
return a target wwn of None.

Change-Id: I6ae6870d46937089bd6ed8799895f7068eebf01d
Closes-Bug: 1435935

cinder/volume/drivers/dell/dell_storagecenter_api.py

index 1f5869a44e60142971320b68bd7df1cfccf424ff..31f6428f49b233ca4f07d7b266093c7218bc5857 100644 (file)
@@ -765,9 +765,14 @@ class StorageCenterApi(object):
                 controllerport = self._find_controller_port(
                     self._get_id(cport))
                 if controllerport is not None:
-                    wwn = controllerport.get('WWN')
+                    # This changed case at one point or another.
+                    # Look for both keys.
+                    wwn = controllerport.get('wwn',
+                                             controllerport.get('WWN'))
+                    if wwn is None:
+                        LOG.error(_LE('Find_wwns: Unable to find port wwn'))
                     serverhba = mapping.get('serverHba')
-                    if serverhba is not None:
+                    if wwn is not None and serverhba is not None:
                         hbaname = serverhba.get('instanceName')
                         if hbaname in initiators:
                             if itmap.get(hbaname) is None: