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
def more_info(context): if not context: return True obj, _ = context if isinstance(obj, product.ExistingInstallation): use = "%s installation" % obj.visual_brand elif isinstance(obj, product.XenServerBackup): use = "%s backup" % obj.visual_brand else: return True date = "Unknown" if 'INSTALLATION_DATE' in obj.inventory: date = obj.inventory['INSTALLATION_DATE'] dev = "Unknown" if 'PRIMARY_DISK' in obj.inventory: pd = obj.inventory['PRIMARY_DISK'] if pd == "ToBeDetermined": dev = diskutil.getHumanDiskName(obj.primary_disk) else: dev = "%s (%s)" % (diskutil.getHumanDiskName(os.path.realpath(pd)), diskutil.getHumanDiskName(pd)) tui.update_help_line([' ', ' ']) snackutil.TableDialog(tui.screen, "Details", ("Use:", use), ("Version:", str(obj.visual_version)), ("Build:", str(obj.build)), ("Installed:", date), ("Disk:", dev)) tui.screen.popHelpLine() return True
def disk_details(context): tui.update_help_line([' ', ' ']) table = [("Name:", context)] for label in ("VLAN", "Capacity", "Port", "Description"): table.append((label + ':', luns[context][label])) snackutil.TableDialog(tui.screen, "Disk Details", *table) tui.screen.popHelpLine() return True
def iface_details(context): tui.update_help_line([' ', ' ']) if context: nic = conf[context] table = [("Name:", nic.name), ("Driver:", nic.driver), ("MAC Address:", nic.hwaddr), ("PCI Details:", nic.pci_string)] if nic.smbioslabel != "": table.append(("BIOS Label:", nic.smbioslabel)) snackutil.TableDialog(tui.screen, "Interface Details", *table) else: netifs_all = netutil.getNetifList(include_vlan=True) details = map(lambda x: (x, netutil.ipaddr(x)), filter(netutil.interfaceUp, netifs_all)) snackutil.TableDialog(tui.screen, "Networking Details", *details) tui.screen.popHelpLine() return True
def iface_details(context): tui.update_help_line([' ', ' ']) nic = conf[context] table = [("Name:", nic.name), ("Driver:", nic.driver), ("MAC Address:", nic.hwaddr), ("Link Status:", netutil.linkUp(context) and 'Up' or 'Down')] snackutil.TableDialog(tui.screen, "Interface Details", *table) tui.screen.popHelpLine() return True
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