#NEWLINE# @ wrap_non_libcloud_exceptions #NEWLINE# def destroy_node( self , node , ex_remove_files = True ) : #NEWLINE# #INDENT# '\n        :param ex_remove_files: Remove all the files from the datastore.\n        :type ex_remove_files: ``bool``\n        ' #NEWLINE# ex_remove_files = False #NEWLINE# vm = self . _get_vm_for_node ( node = node ) #NEWLINE# server = self . connection . client #NEWLINE# if ex_remove_files : #NEWLINE# #INDENT# request = VI . Destroy_TaskRequestMsg ( ) #NEWLINE# _this = request . new__this ( vm . _mor ) #NEWLINE# _this . set_attribute_type ( vm . _mor . get_attribute_type ( ) ) #NEWLINE# request . set_element__this ( _this ) #NEWLINE# ret = server . _proxy . Destroy_Task ( request ) . _returnval #NEWLINE# task = VITask ( ret , server ) #NEWLINE# status = task . wait_for_state ( [ task . STATE_SUCCESS , request . STATE_ERROR ] ) #NEWLINE# if ( status == task . STATE_ERROR ) : #NEWLINE# #INDENT# raise LibcloudError ( ( 'Error destroying node: %s' % task . get_error_message ( ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# request = VI . UnregisterVMRequestMsg ( ) #NEWLINE# _this = request . new__this ( vm . _mor ) #NEWLINE# _this . set_attribute_type ( vm . _mor . get_attribute_type ( ) ) #NEWLINE# request . set_element__this ( _this ) #NEWLINE# ret = server . _proxy . UnregisterVM ( request ) #NEWLINE# task = VITask ( ret , server ) #NEWLINE# #UNINDENT# return True