Exemplo n.º 1
0
def disk_more_info(context):
    if not context: return True

    usage = 'unknown'
    (boot, root, state, storage, logs) = diskutil.probeDisk(context)
    if root[0]:
        usage = "%s installation" % MY_PRODUCT_BRAND
    elif storage[0]:
        usage = 'VM storage'
    else:
        # Determine disk is being used as an LVM SR with no partitioning
        rv, out = util.runCmd2([ 'pvs', context, '-o', 'vg_name', '--noheadings' ], with_stdout=True)
        if rv == 0:
            vg_name = out.strip()
            if vg_name.startswith('VG_XenStorage-'):
                usage = 'VM Storage'

    tui.update_help_line([' ', ' '])
    snackutil.TableDialog(tui.screen, "Details", ("Disk:", diskutil.getHumanDiskName(context)),
                          ("Vendor:", diskutil.getDiskDeviceVendor(context)),
                          ("Model:", diskutil.getDiskDeviceModel(context)),
                          ("Serial:", diskutil.getDiskSerialNumber(context)),
                          ("Size:", diskutil.getHumanDiskSize(diskutil.getDiskDeviceSize(context))),
                          ("Current usage:", usage))
    tui.screen.popHelpLine()
    return True
Exemplo n.º 2
0
Arquivo: screens.py Projeto: xtha/pxe
def disk_more_info(context):
    if not context: return True

    usage = 'unknown'
    (boot, state, storage) = diskutil.probeDisk(context)
    if boot[0]:
        usage = "%s installation" % MY_PRODUCT_BRAND
    elif storage[0]:
        usage = 'VM storage'
    else:
        # Determine disk is being used as an LVM SR with no partitioning
        rv, out = util.runCmd2([ 'pvs', context, '-o', 'vg_name', '--noheadings' ], with_stdout=True)
        if rv == 0:
            vg_name = out.strip()
            if vg_name.startswith('VG_XenStorage-'):
                usage = 'VM Storage'

    tui.update_help_line([' ', ' '])
    snackutil.TableDialog(tui.screen, "Details", ("Disk:", diskutil.getHumanDiskName(context)),
                          ("Vendor:", diskutil.getDiskDeviceVendor(context)),
                          ("Model:", diskutil.getDiskDeviceModel(context)),
                          ("Serial:", diskutil.getDiskSerialNumber(context)),
                          ("Size:", diskutil.getHumanDiskSize(diskutil.getDiskDeviceSize(context))),
                          ("Current usage:", usage))
    tui.screen.popHelpLine()
    return True
Exemplo n.º 3
0
Arquivo: report.py Projeto: xtha/pxe
def disk_more_info(context):
    if not context: return True

    usage = 'unknown'
    (boot, state, storage) = diskutil.probeDisk(context)
    if boot[0]:
        usage = "%s installation" % (PRODUCT_BRAND or PLATFORM_NAME)
    elif storage[0]:
        usage = 'VM storage'

    tui.update_help_line([' ', ' '])
    snackutil.TableDialog(tui.screen, "Details", ("Disk:", diskutil.getHumanDiskName(context)),
                          ("Vendor:", diskutil.getDiskDeviceVendor(context)),
                          ("Model:", diskutil.getDiskDeviceModel(context)),
                          ("Size:", diskutil.getHumanDiskSize(diskutil.getDiskDeviceSize(context))),
                          ("Current usage:", usage))
    tui.screen.popHelpLine()
    return True
Exemplo n.º 4
0
def disk_more_info(context):
    if not context: return True

    usage = 'unknown'
    (boot, root, state, storage, logs) = diskutil.probeDisk(context)
    if root[0]:
        usage = "%s installation" % (PRODUCT_BRAND or PLATFORM_NAME)
    elif storage[0]:
        usage = 'VM storage'

    tui.update_help_line([' ', ' '])
    snackutil.TableDialog(
        tui.screen, "Details", ("Disk:", diskutil.getHumanDiskName(context)),
        ("Vendor:", diskutil.getDiskDeviceVendor(context)),
        ("Model:", diskutil.getDiskDeviceModel(context)),
        ("Size:", diskutil.getHumanDiskSize(
            diskutil.getDiskDeviceSize(context))), ("Current usage:", usage))
    tui.screen.popHelpLine()
    return True