dell_storagecenter_driver/iscsi_utils.py
def find_paths(device_id):
    """Looks for the local device paths.

    Note: The first element will be the multipath device if one is present.

    :param device_id: The page 83 device id.
    :returns: A list of the local paths.
    """
    result = []
    regex = re.compile('sd[a-z]+(?![\d])')
    for dev in os.listdir('/dev/'):
        if regex.match(dev):
            try:
                output = _exec('/lib/udev/scsi_id --page=0x83 '
                               '--whitelisted --device=/dev/%s' %
                               dev)
                if device_id in output:
                    LOG.info('Found %s at %s', device_id, dev)
                    result.append('/dev/%s' % dev)
            except Exception:
                LOG.exception('Error getting device id for %s', dev)

    # Functional tests always want the same device reported
    result.sort()

    if result:
        # Check if there is a multipath device
        mpath_dev = _get_multipath_device(result[0])
        if mpath_dev:
            LOG.info('Found multipath device %s', mpath_dev)
            result.insert(0, mpath_dev)
    return result
Looks for the local device paths.

    Note: The first element will be the multipath device if one is present.

    :param device_id: The page 83 device id.
    :returns: A list of the local paths.
    
Looks for the local device paths.
Note: The first element will be the multipath device if one is present.
Looks for the local device paths . Note : The first element will be the multipath device if one is present .
def find_paths(device_id):
    result = []
    regex = re.compile('sd[a-z]+(?![\d])')
    for dev in os.listdir('/dev/'):
        if regex.match(dev):
            try:
                output = _exec('/lib/udev/scsi_id --page=0x83 '
                               '--whitelisted --device=/dev/%s' %
                               dev)
                if device_id in output:
                    LOG.info('Found %s at %s', device_id, dev)
                    result.append('/dev/%s' % dev)
            except Exception:
                LOG.exception('Error getting device id for %s', dev)
    result.sort()
    if result:
        mpath_dev = _get_multipath_device(result[0])
        if mpath_dev:
            LOG.info('Found multipath device %s', mpath_dev)
            result.insert(0, mpath_dev)
    return result
def find_paths ( device_id ) : result = [ ] regex = re . compile ( 'sd[a-z]+(?![\d])' ) for dev in os . listdir ( '/dev/' ) : if regex . match ( dev ) : try : output = _exec ( '/lib/udev/scsi_id --page=0x83 ' '--whitelisted --device=/dev/%s' % dev ) if device_id in output : LOG . info ( 'Found %s at %s' , device_id , dev ) result . append ( '/dev/%s' % dev ) except Exception : LOG . exception ( 'Error getting device id for %s' , dev ) result . sort ( ) if result : mpath_dev = _get_multipath_device ( result [ 0 ] ) if mpath_dev : LOG . info ( 'Found multipath device %s' , mpath_dev ) result . insert ( 0 , mpath_dev ) return result
Looks for the local device paths.
Looks for the local device paths .
"""Looks for the local device paths.

    Note: The first element will be the multipath device if one is present.

    :param device_id: The page 83 device id.
    :returns: A list of the local paths.
    """ # Functional tests always want the same device reported # Check if there is a multipath device
A list of the local paths.
A list of the local paths .
device_id
The page 83 device id.
The page 83 device id .