#NEWLINE# def __init__( self , id , properties , parent ) : #NEWLINE# #INDENT# 'Constructor for a LogicalDrive object.' #NEWLINE# self . id = id [ 15 : ] #NEWLINE# self . parent = parent #NEWLINE# self . properties = properties #NEWLINE# size = self . properties [ 'Size' ] . replace ( ' ' , '' ) #NEWLINE# try : #NEWLINE# #INDENT# self . size_gb = ( int ( ( strutils . string_to_bytes ( size , return_int = True ) / ( ( 1024 * 1024 ) * 1024 ) ) ) - 1 ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# msg = ( "hpssacli returned unknown size '%(size)s' for logical disk '%(logical_disk)s' of RAID array '%(array)s' in controller '%(controller)s'." % { #NEWLINE# #INDENT# 'size' : size , #NEWLINE# 'logical_disk' : self . id , #NEWLINE# 'array' : self . parent . id , #NEWLINE# 'controller' : self . parent . parent . id , #NEWLINE# #UNINDENT# } ) #NEWLINE# raise exception . HPSSAOperationError ( reason = msg ) #NEWLINE# #UNINDENT# self . raid_level = self . properties . get ( 'Fault Tolerance' ) #NEWLINE# raid_level_mapping = constants . RAID_LEVEL_HPSSA_TO_INPUT_MAPPING #NEWLINE# self . raid_level = raid_level_mapping . get ( self . raid_level , self . raid_level ) #NEWLINE# self . volume_name = self . properties . get ( 'Logical Drive Label' ) #NEWLINE# wwn = self . properties . get ( 'Unique Identifier' ) #NEWLINE# if wwn : #NEWLINE# #INDENT# wwn = ( '0x' + wwn [ : 16 ] . lower ( ) ) #NEWLINE# self . wwn = wwn