#NEWLINE# @ operation #NEWLINE# def delete( cloudify_agent = None , **_ ) : #NEWLINE# #INDENT# installer = get_backend ( cloudify_agent ) #NEWLINE# installer . delete ( ) #NEWLINE# worker_name = installer . agent_name #NEWLINE# with update_storage ( ctx ) as data : #NEWLINE# #INDENT# if ( 'raise_exception_on_delete' in data ) : #NEWLINE# #INDENT# raise Exception ( 'Exception raised intentionally' ) #NEWLINE# #UNINDENT# data [ worker_name ] = data . get ( data , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# data [ worker_name ] [ 'states' ] = data [ worker_name ] . get ( 'states' , [ ] ) #NEWLINE# data [ worker_name ] [ 'states' ] . append ( 'deleted' ) #NEWLINE# #UNINDENT# if ( ctx . type == context . NODE_INSTANCE ) : #NEWLINE# #INDENT# del ctx . instance . runtime_properties [ 'cloudify_agent' ]