#NEWLINE# def get_size( instance ) : #NEWLINE# #INDENT# if hasattr ( instance , 'full_flavor' ) : #NEWLINE# #INDENT# template_name = 'project/instances/_instance_flavor.html' #NEWLINE# size_ram = sizeformat . mb_float_format ( instance . full_flavor . ram ) #NEWLINE# if ( instance . full_flavor . disk > 0 ) : #NEWLINE# #INDENT# size_disk = sizeformat . diskgbformat ( instance . full_flavor . disk ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# size_disk = ( _ ( '%s GB' ) % '0' ) #NEWLINE# #UNINDENT# context = { #NEWLINE# #INDENT# 'name' : size_ram . full_flavor . name , #NEWLINE# 'id' : instance . id , #NEWLINE# 'size_disk' : size_disk , #NEWLINE# 'size_ram' : size_ram , #NEWLINE# 'vcpus' : instance . full_flavor . vcpus , #NEWLINE# #UNINDENT# } #NEWLINE# return template . loader . render_to_string ( template_name , context ) #NEWLINE# #UNINDENT# return _ ( 'Not available' )