#NEWLINE# @ wsgi . response ( 202 ) #NEWLINE# @ wsgi . action ( 'revertResize' ) #NEWLINE# def _action_revert_resize( self , req , id , body ) : #NEWLINE# #INDENT# context = req . environ [ 'nova.context' ] #NEWLINE# instance = self . _get_server ( context , req , id ) #NEWLINE# try : #NEWLINE# #INDENT# self . compute_api . revert_resize ( context , instance ) #NEWLINE# #UNINDENT# except exception . MigrationNotFound : #NEWLINE# #INDENT# msg = _ ( 'Instance has not been resized.' ) #NEWLINE# raise exc . HTTPBadRequest ( explanation = msg ) #NEWLINE# #UNINDENT# except exception . FlavorNotFound : #NEWLINE# #INDENT# msg = _ ( 'Flavor used by the instance could not be found.' ) #NEWLINE# raise exc . HTTPBadRequest ( explanation = msg ) #NEWLINE# #UNINDENT# except exception . InstanceIsLocked as e : #NEWLINE# #INDENT# raise exc . HTTPConflict ( explanation = e . format_message ( ) ) #NEWLINE# #UNINDENT# except exception . InstanceInvalidState as state_error : #NEWLINE# #INDENT# common . raise_http_conflict_for_instance_invalid_state ( state_error , 'revertResize' , id ) #NEWLINE# #UNINDENT# return webob . Response ( status_int = 202 )