コード例 #1
0
def parseIoSlot(buffer):
    """
    Parses and sets the values for the Physical I/O Slots Do
    @param buffer: output of the command ''
    @type buffer: String
    @return: IoSlotDo instance
    """
    if buffer:
        ioSlot = ibm_hmc_lib.IoSlot()
        propertiesDict = ibm_hmc_lib.buildPropertiesDict(buffer)
        ioSlot.drcName = propertiesDict.get('drc_name')
        if not ioSlot.drcName:
            raise ValueError, "Failed parsing I/O Slot for %s" % buffer
        ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(
            ioSlot.drcName)
        ioSlot.name = propertiesDict.get('description')
        ioSlot.busId = propertiesDict.get('bus_id')
        ioSlot.physLoc = propertiesDict.get('unit_phys_loc')
        ioSlot.pciRevId = propertiesDict.get('pci_revision_id')
        ioSlot.busGrouping = propertiesDict.get('bus_grouping')
        ioSlot.pciDeviceId = propertiesDict.get('pci_device_id')
        ioSlot.physLocOnBus = propertiesDict.get('phys_loc')
        ioSlot.parentDrcIndex = propertiesDict.get('parent_slot_drc_index')
        ioSlot.drcIndex = propertiesDict.get('drc_index')
        ioSlot.subSlotVendorId = propertiesDict.get('pci_subs_vendor_id')
        ioSlot.pciClass = propertiesDict.get('pci_class')
        ioSlot.ioPoolId = propertiesDict.get('slot_io_pool_id')
        ioSlot.vendorId = propertiesDict.get('pci_vendor_id')
        ioSlot.featureCodes = propertiesDict.get('feature_codes')
        ioSlot.subslotDeviceId = propertiesDict.get('pci_subs_device_id')
        ioSlot.lpar_name = propertiesDict.get('lpar_name')
        ioSlot.lpar_id = ibm_hmc_lib.toInteger(propertiesDict.get('lpar_id'))
        return ioSlot
コード例 #2
0
def parseIoSlot(buffer):
    """
    Parses and sets the values for the Physical I/O Slots Do
    @param buffer: output of the command ''
    @type buffer: String
    @return: IoSlotDo instance
    """
    if buffer:
        ioSlot = ibm_hmc_lib.IoSlot()
        propertiesDict = ibm_hmc_lib.buildPropertiesDict(buffer)
        ioSlot.drcName = propertiesDict.get('drc_name')
        if not ioSlot.drcName:
            raise ValueError, "Failed parsing I/O Slot for %s" % buffer
        ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(ioSlot.drcName)
        ioSlot.name = propertiesDict.get('description')
        ioSlot.busId = propertiesDict.get('bus_id')
        ioSlot.physLoc = propertiesDict.get('unit_phys_loc')
        ioSlot.pciRevId = propertiesDict.get('pci_revision_id')
        ioSlot.busGrouping = propertiesDict.get('bus_grouping')
        ioSlot.pciDeviceId = propertiesDict.get('pci_device_id')
        ioSlot.physLocOnBus = propertiesDict.get('phys_loc')
        ioSlot.parentDrcIndex = propertiesDict.get('parent_slot_drc_index')
        ioSlot.drcIndex = propertiesDict.get('drc_index')
        ioSlot.subSlotVendorId = propertiesDict.get('pci_subs_vendor_id')
        ioSlot.pciClass = propertiesDict.get('pci_class')
        ioSlot.ioPoolId = propertiesDict.get('slot_io_pool_id')
        ioSlot.vendorId = propertiesDict.get('pci_vendor_id')
        ioSlot.featureCodes = propertiesDict.get('feature_codes')
        ioSlot.subslotDeviceId = propertiesDict.get('pci_subs_device_id')
        ioSlot.lpar_name = propertiesDict.get('lpar_name')
        ioSlot.lpar_id = ibm_hmc_lib.toInteger(propertiesDict.get('lpar_id'))
        return ioSlot
コード例 #3
0
def parseVirtIoSlots(buffer):
    """
    Parses and sets the values for the Virtual I/O Slots Do
    @param buffer: output of the command ''
    @type buffer: String
    @return: IoSlotDo instance
    """
    if buffer:
        ioSlot = ibm_hmc_lib.IoSlot()
        propertiesDict = ibm_hmc_lib.buildPropertiesDict(buffer)
        ioSlot.drcName = propertiesDict.get('drc_name')
        if not ioSlot.drcName:
            raise ValueError, "Failed parsing virtual I/O Slot for %s" % buffer
        ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(ioSlot.drcName)
        ioSlot.name = ioSlot.drcName
        ioSlot.lpar_name = propertiesDict.get('lpar_name')
        ioSlot.lpar_id = ibm_hmc_lib.toInteger(propertiesDict.get('lpar_id'))
        ioSlot.isVirtual = 1
        ioSlot.slotNum = propertiesDict.get('slot_num')
        ioSlot.slotType = propertiesDict.get('config')
        return ioSlot
コード例 #4
0
def parseVirtIoSlots(buffer):
    """
    Parses and sets the values for the Virtual I/O Slots Do
    @param buffer: output of the command ''
    @type buffer: String
    @return: IoSlotDo instance
    """
    if buffer:
        ioSlot = ibm_hmc_lib.IoSlot()
        propertiesDict = ibm_hmc_lib.buildPropertiesDict(buffer)
        ioSlot.drcName = propertiesDict.get('drc_name')
        if not ioSlot.drcName:
            raise ValueError, "Failed parsing virtual I/O Slot for %s" % buffer
        ioSlot.normalizedDrcName = ibm_hmc_lib.normaliseIoSlotDrcName(
            ioSlot.drcName)
        ioSlot.name = ioSlot.drcName
        ioSlot.lpar_name = propertiesDict.get('lpar_name')
        ioSlot.lpar_id = ibm_hmc_lib.toInteger(propertiesDict.get('lpar_id'))
        ioSlot.isVirtual = 1
        ioSlot.slotNum = propertiesDict.get('slot_num')
        ioSlot.slotType = propertiesDict.get('config')
        return ioSlot