]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Dell SC: Added logging for the find_wwns functions
authorTom Swanson <tom_swanson@dell.com>
Fri, 21 Aug 2015 22:00:23 +0000 (17:00 -0500)
committerTom Swanson <tom_swanson@dell.com>
Fri, 21 Aug 2015 22:02:54 +0000 (17:02 -0500)
Added additional LOG.debug() statements to find_wwns and associated
functions.  Right now there aren't enough bread crumbs to easily triage
a problem with the return for the FC intitialize_connection function.

Change-Id: Ia283ae16b028395bbb699da5c38f355e6cb24cfe

cinder/volume/drivers/dell/dell_storagecenter_api.py

index fc52f94c2546725e6278890cb2793635f15ee2d4..40bd6293fca421b82e2fd78702dd997c1d477042 100644 (file)
@@ -1032,6 +1032,7 @@ class StorageCenterApi(object):
                       {'code': r.status_code,
                        'reason': r.reason})
             LOG.error(_LE('Unable to find FC initiators'))
+        LOG.debug(initiators)
         return initiators
 
     def get_volume_count(self, scserver):
@@ -1068,6 +1069,7 @@ class StorageCenterApi(object):
                           scvolume.get('name'))
         else:
             LOG.error(_LE('_find_mappings: volume is not active'))
+        LOG.debug(mappings)
         return mappings
 
     def _find_mapping_profiles(self, scvolume):
@@ -1090,6 +1092,7 @@ class StorageCenterApi(object):
                           scvolume.get('name'))
         else:
             LOG.error(_LE('_find_mappings: volume is not active'))
+        LOG.debug(mapping_profiles)
         return mapping_profiles
 
     def _find_controller_port(self, cportid):
@@ -1109,6 +1112,7 @@ class StorageCenterApi(object):
                        'reason': r.reason})
             LOG.error(_LE('Unable to find controller port: %s'),
                       cportid)
+        LOG.debug(controllerport)
         return controllerport
 
     def find_wwns(self, scvolume, scserver):
@@ -1140,24 +1144,32 @@ class StorageCenterApi(object):
                     # 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 wwn is not None and serverhba is not None:
-                        hbaname = serverhba.get('instanceName')
-                        if hbaname in initiators:
-                            if itmap.get(hbaname) is None:
-                                itmap[hbaname] = []
-                            itmap[hbaname].append(wwn)
-                            wwns.append(wwn)
-
-                            mappinglun = mapping.get('lun')
-                            if lun is None:
-                                lun = mappinglun
-                            elif lun != mappinglun:
-                                LOG.warning(_LW('Inconsistent Luns.'))
+                    if wwn:
+                        serverhba = mapping.get('serverHba')
+                        if serverhba:
+                            hbaname = serverhba.get('instanceName')
+                            if hbaname in initiators:
+                                if itmap.get(hbaname) is None:
+                                    itmap[hbaname] = []
+                                itmap[hbaname].append(wwn)
+                                wwns.append(wwn)
+
+                                mappinglun = mapping.get('lun')
+                                if lun is None:
+                                    lun = mappinglun
+                                elif lun != mappinglun:
+                                    LOG.warning(_LW('Inconsistent Luns.'))
+                            else:
+                                LOG.debug('%s not found in initiator list',
+                                          hbaname)
+                        else:
+                            LOG.debug('serverhba is None.')
+                    else:
+                        LOG.debug('Unable to find port wwn.')
+                else:
+                    LOG.debug('controllerport is None.')
         else:
-            LOG.error(_LE('Find_wwns: Volume appears unmapped'))
+            LOG.error(_LE('Volume appears unmapped'))
         LOG.debug(lun)
         LOG.debug(wwns)
         LOG.debug(itmap)