#NEWLINE# def delete_vm( server , vm_obj ) : #NEWLINE# #INDENT# request = VI . Destroy_TaskRequestMsg ( ) #NEWLINE# _this = request . new__this ( vm_obj . _mor ) #NEWLINE# _this . set_attribute_type ( vm_obj . _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 , task . STATE_ERROR ] ) #NEWLINE# if ( status != task . STATE_SUCCESS ) : #NEWLINE# #INDENT# raise HypervisorError ( ( 'Guest:delete %s' % task . get_error_message ( ) ) )