#NEWLINE# def to_dict_legacy( self , host_topology ) : #NEWLINE# #INDENT# cells = [ ] #NEWLINE# for cell in host_topology . cells : #NEWLINE# #INDENT# cells . append ( { #NEWLINE# #INDENT# 'cpus' : hardware . format_cpu_spec ( cell . cpuset , allow_ranges = False ) , #NEWLINE# 'mem' : { #NEWLINE# #INDENT# 'total' : cell . memory , #NEWLINE# 'limit' : ( cell . memory * self . ram_allocation_ratio ) , #NEWLINE# #UNINDENT# } , #NEWLINE# 'cpu_limit' : ( len ( cell . cpuset ) * self . cpu_allocation_ratio ) , #NEWLINE# 'id' : cell . id , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'cells' : cells , #NEWLINE# #UNINDENT# }