dell_storagecenter_driver/iscsi_utils.py
def remove_device(path):
    """Prepare removal of SCSI device.

    :param path: The /dev/sdX or /dev/mapper/X path to remove.
    """
    if not path:
        return

    if '/dev/sd' in path:
        sd = path.replace('/dev/', '')
        remove_path = '/sys/block/%s/device/delete' % sd
        if os.path.exists(remove_path):
            try:
                _exec('blockdev --flushbufs %s' % path)
                time.sleep(4)
            except Exception:
                LOG.exception('Error flushing IO to %s', path)
            try:
                _exec('sh -c "echo 1 > %s"' % remove_path)
                time.sleep(1)
            except Exception:
                LOG.exception('Error removing device %s', sd)
    else:
        try:
            path = path.replace('/dev/mapper/', '')
            _exec('multipath -f %s' % path)
        except Exception:
            LOG.exception('Error removing multipath device %s', path)
Prepare removal of SCSI device.

    :param path: The /dev/sdX or /dev/mapper/X path to remove.
    
Prepare removal of SCSI device.
Prepare removal of SCSI device .
def remove_device(path):
    if not path:
        return
    if '/dev/sd' in path:
        sd = path.replace('/dev/', '')
        remove_path = '/sys/block/%s/device/delete' % sd
        if os.path.exists(remove_path):
            try:
                _exec('blockdev --flushbufs %s' % path)
                time.sleep(4)
            except Exception:
                LOG.exception('Error flushing IO to %s', path)
            try:
                _exec('sh -c "echo 1 > %s"' % remove_path)
                time.sleep(1)
            except Exception:
                LOG.exception('Error removing device %s', sd)
    else:
        try:
            path = path.replace('/dev/mapper/', '')
            _exec('multipath -f %s' % path)
        except Exception:
            LOG.exception('Error removing multipath device %s', path)
def remove_device ( path ) : if not path : return if '/dev/sd' in path : sd = path . replace ( '/dev/' , '' ) remove_path = '/sys/block/%s/device/delete' % sd if os . path . exists ( remove_path ) : try : _exec ( 'blockdev --flushbufs %s' % path ) time . sleep ( 4 ) except Exception : LOG . exception ( 'Error flushing IO to %s' , path ) try : _exec ( 'sh -c "echo 1 > %s"' % remove_path ) time . sleep ( 1 ) except Exception : LOG . exception ( 'Error removing device %s' , sd ) else : try : path = path . replace ( '/dev/mapper/' , '' ) _exec ( 'multipath -f %s' % path ) except Exception : LOG . exception ( 'Error removing multipath device %s' , path )
Prepare removal of SCSI device.
Prepare removal of SCSI device .
"""Prepare removal of SCSI device.

    :param path: The /dev/sdX or /dev/mapper/X path to remove.
    """
path
The /dev/sdX or /dev/mapper/X path to remove.
The / dev / sdX or / dev / mapper / X path to remove .