Exemple #1
0
def _pool_status_of_cim_pool(dmtf_op_status_list):
    """
    Convert CIM_StoragePool['OperationalStatus'] to LSM
    """
    return dmtf.op_status_list_conv(_LSM_POOL_OP_STATUS_CONV,
                                    dmtf_op_status_list, Pool.STATUS_UNKNOWN,
                                    Pool.STATUS_OTHER)
def _pool_status_of_cim_pool(dmtf_op_status_list):
    """
    Convert CIM_StoragePool['OperationalStatus'] to LSM
    """
    return dmtf.op_status_list_conv(
        _LSM_POOL_OP_STATUS_CONV, dmtf_op_status_list,
        Pool.STATUS_UNKNOWN, Pool.STATUS_OTHER)
Exemple #3
0
def _disk_status_of_cim_disk(cim_disk):
    """
    Convert CIM_DiskDrive['OperationalStatus'] to LSM
    Only return status, no status_info
    """
    if 'OperationalStatus' not in cim_disk:
        return Disk.STATUS_UNKNOWN

    return dmtf.op_status_list_conv(_LSM_DISK_OP_STATUS_CONV,
                                    cim_disk['OperationalStatus'],
                                    Disk.STATUS_UNKNOWN, Disk.STATUS_OTHER)[0]
def _disk_status_of_cim_disk(cim_disk):
    """
    Convert CIM_DiskDrive['OperationalStatus'] to LSM
    Only return status, no status_info
    """
    if 'OperationalStatus' not in cim_disk:
        return Disk.STATUS_UNKNOWN

    return dmtf.op_status_list_conv(
        _LSM_DISK_OP_STATUS_CONV, cim_disk['OperationalStatus'],
        Disk.STATUS_UNKNOWN, Disk.STATUS_OTHER)[0]
Exemple #5
0
def _sys_status_of_cim_sys(cim_sys):
    """
    Convert CIM_ComputerSystem['OperationalStatus']
    """
    if 'OperationalStatus' not in cim_sys:
        raise LsmError(
            ErrorNumber.PLUGIN_BUG,
            "sys_status_of_cim_sys(): Got a CIM_ComputerSystem with no "
            "OperationalStatus: %s, %s" % (list(cim_sys.items()), cim_sys.path))

    return dmtf.op_status_list_conv(
        _LSM_SYS_OP_STATUS_CONV, cim_sys['OperationalStatus'],
        System.STATUS_UNKNOWN, System.STATUS_OTHER)