dell_storagecenter_driver/dell_storagecenter_api.py
def find_wwns(self, scvolume, scserver):
        """Finds the lun and wwns of the mapped volume.

        :param scvolume: Storage Center volume object.
        :param scserver: Storage Center server opbject.
        :returns: Lun, wwns, initiator target map
        """
        lun = None  # our lun.  We return the first lun.
        wwns = []  # list of targets
        itmap = {}  # dict of initiators and the associated targets

        # Make sure we know our server's initiators.  Only return
        # mappings that contain HBA for this server.
        initiators = self._find_fc_initiators(scserver)
        # Get our volume mappings
        mappings = self._find_mappings(scvolume)
        if len(mappings) > 0:
            # We check each of our mappings.  We want to return
            # the mapping we have been configured to use.
            for mapping in mappings:
                # Find the controller port for this mapping
                cport = mapping.get('controllerPort')
                controllerport = self._find_controller_port(
                    self._get_id(cport))
                if controllerport is not None:
                    # This changed case at one point or another.
                    # Look for both keys.
                    wwn = controllerport.get('wwn',
                                             controllerport.get('WWN'))
                    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('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('Volume appears unmapped')
        LOG.debug(lun)
        LOG.debug(wwns)
        LOG.debug(itmap)
        # TODO(tom_swanson): if we have nothing to return raise an exception
        # here.  We can't do anything with an unmapped volume.  We shouldn't
        # pretend we succeeded.
        return lun, wwns, itmap
Finds the lun and wwns of the mapped volume.

        :param scvolume: Storage Center volume object.
        :param scserver: Storage Center server opbject.
        :returns: Lun, wwns, initiator target map
        
Finds the lun and wwns of the mapped volume.
Finds the lun and wwns of the mapped volume .
def find_wwns(self, scvolume, scserver):
        lun = None  
        wwns = []  
        itmap = {}  
        initiators = self._find_fc_initiators(scserver)
        mappings = self._find_mappings(scvolume)
        if len(mappings) > 0:
            for mapping in mappings:
                cport = mapping.get('controllerPort')
                controllerport = self._find_controller_port(
                    self._get_id(cport))
                if controllerport is not None:
                    wwn = controllerport.get('wwn',
                                             controllerport.get('WWN'))
                    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('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('Volume appears unmapped')
        LOG.debug(lun)
        LOG.debug(wwns)
        LOG.debug(itmap)
        return lun, wwns, itmap
def find_wwns ( self , scvolume , scserver ) : lun = None wwns = [ ] itmap = { } initiators = self . _find_fc_initiators ( scserver ) mappings = self . _find_mappings ( scvolume ) if len ( mappings ) > 0 : for mapping in mappings : cport = mapping . get ( 'controllerPort' ) controllerport = self . _find_controller_port ( self . _get_id ( cport ) ) if controllerport is not None : wwn = controllerport . get ( 'wwn' , controllerport . get ( 'WWN' ) ) 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 ( '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 ( 'Volume appears unmapped' ) LOG . debug ( lun ) LOG . debug ( wwns ) LOG . debug ( itmap ) return lun , wwns , itmap
Finds the lun and wwns of the mapped volume.
Finds the lun and wwns of the mapped volume .
"""Finds the lun and wwns of the mapped volume.

        :param scvolume: Storage Center volume object.
        :param scserver: Storage Center server opbject.
        :returns: Lun, wwns, initiator target map
        """ # our lun.  We return the first lun. # list of targets # dict of initiators and the associated targets # Make sure we know our server's initiators.  Only return # mappings that contain HBA for this server. # Get our volume mappings # We check each of our mappings.  We want to return # the mapping we have been configured to use. # Find the controller port for this mapping # This changed case at one point or another. # Look for both keys. # TODO(tom_swanson): if we have nothing to return raise an exception # here.  We can't do anything with an unmapped volume.  We shouldn't # pretend we succeeded.
Lun, wwns, initiator target map
Lun wwns initiator target map
self
scvolume
Storage Center volume object.
Storage Center volume object .
scserver
Storage Center server opbject.
Storage Center server opbject .