#NEWLINE# def _call_compute_api_with_obj( self , ctxt , instance , method , * args , **kwargs ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# instance . refresh ( ) #NEWLINE# #UNINDENT# except exception . InstanceNotFound : #NEWLINE# #INDENT# with excutils . save_and_reraise_exception ( ) : #NEWLINE# #INDENT# instance = objects . Instance ( context = ctxt , uuid = instance . uuid ) #NEWLINE# self . msg_runner . instance_destroy_at_top ( ctxt , instance ) #NEWLINE# #UNINDENT# #UNINDENT# except exception . InstanceInfoCacheNotFound : #NEWLINE# #INDENT# if ( method not in ( 'delete' , 'force_delete' ) ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# #UNINDENT# fn = getattr ( self . compute_api , method , None ) #NEWLINE# return fn ( ctxt , instance , * args , ** self )