def execute(self, ns, partitions=None):
     """
     Implementation of 'partition show' command.
     """
     if not partitions:
         partitions = partition.get_partitions(ns)
     for part in partitions:
         part = str2device(ns, part)
         cmd = fcmd.NewTableCommand(title=part.DeviceID)
         yield cmd
         for line in show.partition_show(ns, part,
                 self.app.config.human_friendly):
             yield line
 def execute(self, ns, partitions=None):
     """
     Implementation of 'partition show' command.
     """
     if not partitions:
         partitions = partition.get_partitions(ns)
     for part in partitions:
         part = str2device(ns, part)
         cmd = formatter.NewTableCommand(title=part.DeviceID)
         yield cmd
         for line in show.partition_show(ns, part,
                                         self.app.config.human_friendly):
             yield line
 def execute(self, ns, devices=None):
     """
     Implementation of 'partition list' command.
     """
     for part in partition.get_partitions(ns, devices):
         ptype = ""
         values = ns.LMI_DiskPartition.PartitionTypeValues
         if "PartitionType" in part.properties():
             if part.PartitionType == values.Primary:
                 ptype = "primary"
             elif part.PartitionType == values.Extended:
                 ptype = "extended"
             elif part.PartitionType == values.Logical:
                 ptype = "logical"
             else:
                 ptype = "unknown"
         size = size2str(part.NumberOfBlocks * part.BlockSize,
                         self.app.config.human_friendly)
         yield (part.DeviceID, part.Name, part.ElementName, ptype, size)
 def execute(self, ns, devices=None):
     """
     Implementation of 'partition list' command.
     """
     for part in partition.get_partitions(ns, devices):
         ptype = ""
         values = ns.LMI_DiskPartition.PartitionTypeValues
         if "PartitionType" in part.properties():
             if part.PartitionType == values.Primary:
                 ptype = "primary"
             elif part.PartitionType == values.Extended:
                 ptype = "extended"
             elif part.PartitionType == values.Logical:
                 ptype = "logical"
             else:
                 ptype = "unknown"
         size = size2str(part.NumberOfBlocks * part.BlockSize,
                 self.app.config.human_friendly)
         yield (part.Name, ptype, size)