#NEWLINE# def all_free_space_except_os_for_volume( self , spaces , volume_name ) : #NEWLINE# #INDENT# os_size = self . os_size ( volume_name ) #NEWLINE# reserved_size = self . reserved_size ( spaces ) #NEWLINE# disk_sum_size = sum ( [ disk [ 'size' ] for disk in only_disks ( spaces ) ] ) #NEWLINE# vg_size = 0 #NEWLINE# sum_lvm_meta = 0 #NEWLINE# for disk in only_disks ( spaces ) : #NEWLINE# #INDENT# for volume in disk [ 'volumes' ] : #NEWLINE# #INDENT# if ( ( volume . get ( 'vg' ) == volume_name ) or ( volume . get ( 'name' ) == volume_name ) ) : #NEWLINE# #INDENT# vg_size += volume [ 'size' ] #NEWLINE# vg_size -= volume . get ( 'lvm_meta_size' , 0 ) #NEWLINE# sum_lvm_meta += volume . get ( 'lvm_meta_size' , 0 ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . assertEqual ( vg_size , ( ( ( disk_sum_size - os_size ) - reserved_size ) - sum_lvm_meta ) )