#NEWLINE# def normalize_flavors( flavors ) : #NEWLINE# #INDENT# ' Normalize a list of flavor objects ' #NEWLINE# for flavor in flavors : #NEWLINE# #INDENT# flavor . pop ( 'links' , None ) #NEWLINE# flavor . pop ( 'NAME_ATTR' , None ) #NEWLINE# flavor . pop ( 'HUMAN_ID' , None ) #NEWLINE# flavor . pop ( 'human_id' , None ) #NEWLINE# if ( 'extra_specs' not in flavor ) : #NEWLINE# #INDENT# flavor [ 'extra_specs' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# ephemeral = flavor . pop ( 'OS-FLV-EXT-DATA:ephemeral' , 0 ) #NEWLINE# is_public = flavor . pop ( 'os-flavor-access:is_public' , True ) #NEWLINE# flavor [ 'OS-FLV-EXT-DATA:ephemeral' ] = ephemeral #NEWLINE# flavor [ 'ephemeral' ] = ephemeral #NEWLINE# flavor [ 'os-flavor-access:is_public' ] = is_public #NEWLINE# flavor [ 'is_public' ] = is_public #NEWLINE# #UNINDENT# return flavors