#NEWLINE# def delete( self , req , flavor_id , id ) : #NEWLINE# #INDENT# 'Deletes an existing extra spec.' #NEWLINE# context = req . environ [ 'nova.context' ] #NEWLINE# authorize ( context , action = 'delete' ) #NEWLINE# flavor = common . get_flavor ( context , flavor_id ) #NEWLINE# try : #NEWLINE# #INDENT# del flavor . extra_specs [ id ] #NEWLINE# flavor . save ( ) #NEWLINE# #UNINDENT# except ( exception . FlavorNotFound , exception . FlavorExtraSpecsNotFound ) as e : #NEWLINE# #INDENT# raise exc . HTTPNotFound ( explanation = e . format_message ( ) ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# msg = ( _ ( 'Flavor %(flavor_id)s has no extra specs with key %(key)s.' ) % dict ( flavor_id = flavor_id , key = id ) ) #NEWLINE# raise exc . HTTPNotFound ( explanation = msg )