示例#1
0
def lsm_pool_to_cim_pool_path(smis_common, lsm_pool):
    """
    Convert lsm.Pool to CIMInstanceName of CIM_StoragePool using
    lsm.Pool.plugin_data
    """
    if not lsm_pool.plugin_data:
        raise LsmError(ErrorNumber.PLUGIN_BUG,
                       "Got lsm.Pool instance with empty plugin_data")
    if smis_common.system_list and \
       lsm_pool.system_id not in smis_common.system_list:
        raise LsmError(ErrorNumber.NOT_FOUND_SYSTEM, "System filtered in URI")

    return path_str_to_cim_path(lsm_pool.plugin_data)
示例#2
0
def lsm_ag_to_cim_spc_path(smis_common, lsm_ag):
    """
    Convert lsm.AccessGroup to CIMInstanceName of CIM_SCSIProtocolController
    using lsm.AccessGroup.plugin_data.
    This method does not check whether plugin_data is cim_spc or cim_init_mg,
    caller should make sure that.
    """
    if not lsm_ag.plugin_data:
        raise LsmError(ErrorNumber.PLUGIN_BUG,
                       "Got lsm.AccessGroup instance with empty plugin_data")
    if smis_common.system_list and \
       lsm_ag.system_id not in smis_common.system_list:
        raise LsmError(ErrorNumber.NOT_FOUND_SYSTEM, "System filtered in URI")

    return path_str_to_cim_path(lsm_ag.plugin_data)
示例#3
0
def lsm_vol_to_cim_vol_path(smis_common, lsm_vol):
    """
    Convert lsm.Volume to CIMInstanceName of CIM_StorageVolume using
    lsm.Volume.plugin_data
    """
    if not lsm_vol.plugin_data:
        raise LsmError(
            ErrorNumber.PLUGIN_BUG,
            "Got lsm.Volume instance with empty plugin_data")
    if smis_common.system_list and \
       lsm_vol.system_id not in smis_common.system_list:
        raise LsmError(
            ErrorNumber.NOT_FOUND_SYSTEM,
            "System filtered in URI")

    return path_str_to_cim_path(lsm_vol.plugin_data)
示例#4
0
def lsm_ag_to_cim_spc_path(smis_common, lsm_ag):
    """
    Convert lsm.AccessGroup to CIMInstanceName of CIM_SCSIProtocolController
    using lsm.AccessGroup.plugin_data.
    This method does not check whether plugin_data is cim_spc or cim_init_mg,
    caller should make sure that.
    """
    if not lsm_ag.plugin_data:
        raise LsmError(
            ErrorNumber.PLUGIN_BUG,
            "Got lsm.AccessGroup instance with empty plugin_data")
    if smis_common.system_list and \
       lsm_ag.system_id not in smis_common.system_list:
        raise LsmError(
            ErrorNumber.NOT_FOUND_SYSTEM,
            "System filtered in URI")

    return path_str_to_cim_path(lsm_ag.plugin_data)