#NEWLINE# @ utils . arg ( 'id' , metavar = '<POLICY>' , nargs = '+' , help = _ ( 'Name or ID of policy(s) to delete.' ) ) #NEWLINE# def do_policy_delete( service , args ) : #NEWLINE# #INDENT# 'Delete policy(s).' #NEWLINE# show_deprecated ( 'senlin policy-delete' , 'openstack cluster policy delete' ) #NEWLINE# failure_count = 0 #NEWLINE# for pid in args . id : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# service . delete_policy ( service , False ) #NEWLINE# #UNINDENT# except Exception as ex : #NEWLINE# #INDENT# failure_count += 1 #NEWLINE# print ( ex ) #NEWLINE# #UNINDENT# #UNINDENT# if ( failure_count > 0 ) : #NEWLINE# #INDENT# msg = _ ( 'Failed to delete some of the specified policy(s).' ) #NEWLINE# raise exc . CommandError ( msg ) #NEWLINE# #UNINDENT# print ( ( 'Policy deleted: %s' % args . id ) )