rtslib/utils.py
def convert_scsi_path_to_hctl(path):
    '''
    This function returns the SCSI ID in H:C:T:L form for the block
    device being mapped to the udev path specified.
    If no match is found, None is returned.

    >>> import rtslib.utils as utils
    >>> utils.convert_scsi_path_to_hctl('/dev/scd0')
    (2, 0, 0, 0)
    >>> utils.convert_scsi_path_to_hctl('/dev/sr0')
    (2, 0, 0, 0)
    >>> utils.convert_scsi_path_to_hctl('/dev/sda')
    (3, 0, 0, 0)
    >>> utils.convert_scsi_path_to_hctl('/dev/sda1')
    >>> utils.convert_scsi_path_to_hctl('/dev/sdb')
    (3, 0, 1, 0)
    >>> utils.convert_scsi_path_to_hctl('/dev/sdc')
    (3, 0, 2, 0)

    @param path: The udev path to the SCSI block device.
    @type path: string
    @return: An (host, controller, target, lun) tuple of integer
    values representing the SCSI ID of the device, or raise RTSLibError.
    '''
    try:
        path = os.path.realpath(path)
        device = pyudev.Device.from_device_file(_CONTEXT, path)
        parent = device.find_parent(subsystem='scsi')
        return [int(data) for data in parent.sys_name.split(':')]
    except:
        raise RTSLibError("Could not convert scsi path to hctl")

    This function returns the SCSI ID in H:C:T:L form for the block
    device being mapped to the udev path specified.
    If no match is found, None is returned.

    >>> import rtslib.utils as utils
    >>> utils.convert_scsi_path_to_hctl('/dev/scd0')
    (2, 0, 0, 0)
    >>> utils.convert_scsi_path_to_hctl('/dev/sr0')
    (2, 0, 0, 0)
    >>> utils.convert_scsi_path_to_hctl('/dev/sda')
    (3, 0, 0, 0)
    >>> utils.convert_scsi_path_to_hctl('/dev/sda1')
    >>> utils.convert_scsi_path_to_hctl('/dev/sdb')
    (3, 0, 1, 0)
    >>> utils.convert_scsi_path_to_hctl('/dev/sdc')
    (3, 0, 2, 0)

    @param path: The udev path to the SCSI block device.
    @type path: string
    @return: An (host, controller, target, lun) tuple of integer
    values representing the SCSI ID of the device, or raise RTSLibError.
    
This function returns the SCSI ID in H:C:T:L form for the block
device being mapped to the udev path specified.
If no match is found, None is returned.


This function returns the SCSI ID in H : C : T : L form for the block device being mapped to the udev path specified . If no match is found None is returned .
def convert_scsi_path_to_hctl(path):
    try:
        path = os.path.realpath(path)
        device = pyudev.Device.from_device_file(_CONTEXT, path)
        parent = device.find_parent(subsystem='scsi')
        return [int(data) for data in parent.sys_name.split(':')]
    except:
        raise RTSLibError("Could not convert scsi path to hctl")
def convert_scsi_path_to_hctl ( path ) : try : path = os . path . realpath ( path ) device = pyudev . Device . from_device_file ( _CONTEXT , path ) parent = device . find_parent ( subsystem = 'scsi' ) return [ int ( data ) for data in parent . sys_name . split ( ':' ) ] except : raise RTSLibError ( "Could not convert scsi path to hctl" )
This function returns the SCSI ID in H:C:T:L form for the block
device being mapped to the udev path specified.
This function returns the SCSI ID in H : C : T : L form for the block device being mapped to the udev path specified .
'''
    This function returns the SCSI ID in H:C:T:L form for the block
    device being mapped to the udev path specified.
    If no match is found, None is returned.

    >>> import rtslib.utils as utils
    >>> utils.convert_scsi_path_to_hctl('/dev/scd0')
    (2, 0, 0, 0)
    >>> utils.convert_scsi_path_to_hctl('/dev/sr0')
    (2, 0, 0, 0)
    >>> utils.convert_scsi_path_to_hctl('/dev/sda')
    (3, 0, 0, 0)
    >>> utils.convert_scsi_path_to_hctl('/dev/sda1')
    >>> utils.convert_scsi_path_to_hctl('/dev/sdb')
    (3, 0, 1, 0)
    >>> utils.convert_scsi_path_to_hctl('/dev/sdc')
    (3, 0, 2, 0)

    @param path: The udev path to the SCSI block device.
    @type path: string
    @return: An (host, controller, target, lun) tuple of integer
    values representing the SCSI ID of the device, or raise RTSLibError.
    '''
An (host, controller, target, lun) tuple of integer
values representing the SCSI ID of the device, or raise RTSLibError.
An ( host controller target lun ) tuple of integer values representing the SCSI ID of the device or raise RTSLibError .
path
The udev path to the SCSI block device.
The udev path to the SCSI block device .