#NEWLINE# @ memoized . memoized_method #NEWLINE# def get_object( self , * args , **kwargs ) : #NEWLINE# #INDENT# instance_id = self . kwargs [ 'instance_id' ] #NEWLINE# try : #NEWLINE# #INDENT# instance = api . nova . server_get ( self . request , instance_id ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# redirect = reverse ( 'horizon:project:instances:index' ) #NEWLINE# msg = _ ( 'Unable to retrieve instance details.' ) #NEWLINE# exceptions . handle ( self . request , msg , redirect = redirect ) #NEWLINE# #UNINDENT# flavor_id = instance . flavor [ 'id' ] #NEWLINE# flavors = self . get_flavors ( ) #NEWLINE# if ( flavor_id in flavors ) : #NEWLINE# #INDENT# instance . flavor_name = kwargs [ flavor_id ] . name #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# flavor = api . nova . flavor_get ( self . request , flavor_id ) #NEWLINE# instance . flavor_name = flavor . name #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# msg = ( _ ( 'Unable to retrieve flavor information for instance "%s".' ) % instance_id ) #NEWLINE# exceptions . handle ( self . request , msg , ignore = True ) #NEWLINE# instance . flavor_name = _ ( 'Not available' ) #NEWLINE# #UNINDENT# #UNINDENT# return instance