#NEWLINE# @ wsgi . Controller . api_version ( '2.24' ) #NEWLINE# @ wsgi . response ( 202 ) #NEWLINE# @ extensions . expected_errors ( ( 400 , 404 , 409 ) ) #NEWLINE# def delete( self , req , server_id , id ) : #NEWLINE# #INDENT# 'Abort an in progress migration of an instance.' #NEWLINE# context = req . environ [ 'nova.context' ] #NEWLINE# authorize ( context , action = 'delete' ) #NEWLINE# instance = common . get_instance ( self . compute_api , context , server_id ) #NEWLINE# try : #NEWLINE# #INDENT# self . compute_api . live_migrate_abort ( context , instance , id ) #NEWLINE# #UNINDENT# except exception . InstanceInvalidState as state_error : #NEWLINE# #INDENT# common . raise_http_conflict_for_instance_invalid_state ( self , 'abort live migration' , server_id ) #NEWLINE# #UNINDENT# except exception . MigrationNotFoundForInstance as e : #NEWLINE# #INDENT# raise exc . HTTPNotFound ( explanation = e . format_message ( ) ) #NEWLINE# #UNINDENT# except exception . InvalidMigrationState as e : #NEWLINE# #INDENT# raise exc . HTTPBadRequest ( explanation = e . format_message ( ) )