#NEWLINE# def delete( self , req , id ) : #NEWLINE# #INDENT# 'Delete a snapshot.' #NEWLINE# context = req . environ [ 'nova.context' ] #NEWLINE# authorize ( context , action = 'delete' ) #NEWLINE# LOG . info ( _LI ( 'Delete snapshot with id: %s' ) , id , context = context ) #NEWLINE# delete_metadata = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# delete_metadata . update ( req . GET ) #NEWLINE# try : #NEWLINE# #INDENT# delete_info = jsonutils . loads ( delete_metadata [ 'delete_info' ] ) #NEWLINE# volume_id = delete_info [ 'volume_id' ] #NEWLINE# #UNINDENT# except ( KeyError , ValueError ) as e : #NEWLINE# #INDENT# raise webob . exc . HTTPBadRequest ( explanation = six . text_type ( id ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . compute_api . volume_snapshot_delete ( context , volume_id , id , delete_info ) #NEWLINE# #UNINDENT# except exception . NotFound : #NEWLINE# #INDENT# return webob . exc . HTTPNotFound ( ) #NEWLINE# #UNINDENT# return webob . Response ( status_int = 204 )