def execute(self, ns): """ Implementation of 'raid list' command. """ for r in raid.get_raids(ns): members = raid.get_raid_members(ns, r) yield (r.ElementName, r.Level, len(members))
def raid_show(ns, r, human_friendly): """ Print extended information about the RAID. :type r: LMIInstance/LMI_MDRAIDStorageExtent or string :param r: RAID to show. """ r = common.str2device(ns, r) yield ("Type", "MD RAID") for line in device_show_device(ns, r, human_friendly): yield line yield ("RAID Level", r.Level) members = raid.get_raid_members(ns, r) mnames = [r.Name for r in members] yield ("RAID Members", " ".join(mnames)) for line in device_show_data(ns, r, human_friendly): yield line