#NEWLINE# def execute( self , ns , devices = None ) : #NEWLINE# #INDENT# "\n        Implementation of 'partition list' command.\n        " #NEWLINE# for part in partition . get_partitions ( ns , devices ) : #NEWLINE# #INDENT# ptype = '' #NEWLINE# values = ns . LMI_DiskPartition . PartitionTypeValues #NEWLINE# if ( 'PartitionType' in part . properties ( ) ) : #NEWLINE# #INDENT# if ( part . PartitionType == values . Primary ) : #NEWLINE# #INDENT# ptype = 'primary' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( part . PartitionType == values . Extended ) : #NEWLINE# #INDENT# ptype = 'extended' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( part . PartitionType == values . Logical ) : #NEWLINE# #INDENT# ptype = 'logical' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ptype = 'unknown' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# size = size2str ( ( part . NumberOfBlocks * ns . BlockSize ) , self . app . config . human_friendly ) #NEWLINE# ( yield ( part . Name , ptype , size ) )