#NEWLINE# def delete( self , req , id ) : #NEWLINE# #INDENT# context = sg . _authorize_context ( req ) #NEWLINE# authorize ( context ) #NEWLINE# nova_context . require_admin_context ( context ) #NEWLINE# try : #NEWLINE# #INDENT# id = self . security_group_api . validate_id ( id ) #NEWLINE# #UNINDENT# except exception . Invalid as ex : #NEWLINE# #INDENT# raise exc . HTTPBadRequest ( explanation = ex . format_message ( ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# rule = self . security_group_api . get_default_rule ( context , rule ) #NEWLINE# self . security_group_api . remove_default_rules ( context , [ rule [ 'id' ] ] ) #NEWLINE# #UNINDENT# except exception . SecurityGroupDefaultRuleNotFound as ex : #NEWLINE# #INDENT# raise exc . HTTPNotFound ( explanation = ex . format_message ( ) ) #NEWLINE# #UNINDENT# return webob . Response ( status_int = 204 )