#NEWLINE# def delete_fwrule( kwargs = None , call = None ) : #NEWLINE# #INDENT# '\n    Permanently delete a firewall rule.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt-cloud -f delete_fwrule gce name=allow-http\n    ' #NEWLINE# if ( call != 'function' ) : #NEWLINE# #INDENT# raise SaltCloudSystemExit ( 'The delete_fwrule function must be called with -f or --function.' ) #NEWLINE# #UNINDENT# if ( ( not kwargs ) or ( 'name' not in kwargs ) ) : #NEWLINE# #INDENT# log . error ( 'A name must be specified when deleting a firewall rule.' ) #NEWLINE# return False #NEWLINE# #UNINDENT# name = kwargs [ 'name' ] #NEWLINE# conn = get_conn ( ) #NEWLINE# salt . utils . cloud . fire_event ( 'event' , 'delete firewall' , 'salt/cloud/firewall/deleting' , { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# #UNINDENT# } , transport = __opts__ [ 'transport' ] ) #NEWLINE# try : #NEWLINE# #INDENT# result = conn . ex_destroy_firewall ( conn . ex_get_firewall ( conn ) ) #NEWLINE# #UNINDENT# except ResourceNotFoundError as exc : #NEWLINE# #INDENT# log . error ( 'Rule {0} could not be found.\nThe following exception was thrown by libcloud:\n{1}' . format ( name , exc ) , exc_info_on_loglevel = logging . DEBUG ) #NEWLINE# return False #NEWLINE# #UNINDENT# salt . utils . cloud . fire_event ( 'event' , 'deleted firewall' , 'salt/cloud/firewall/deleted' , { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# #UNINDENT# } , transport = __opts__ [ 'transport' ] ) #NEWLINE# return result