app/controllers/miq_ae_tools_controller.rb
# Reset all custom classes and instances to default
Reset all custom classes and instances to default
Reset all custom classes and instances to default
def reset_datastore
    unless params[:task_id]                       
      initiate_wait_for_task(:task_id => MiqAutomate.async_datastore_reset)
      return
    end
    miq_task = MiqTask.find(params[:task_id])     
    session[:ae_id] = params[:id]
    session[:ae_task_id] = params[:task_id]
    if miq_task.status != "Ok"  
      add_flash(_("Error during reset: Status [%{status}] Message [%{message}]") %
                  {:status => miq_task.status, :message => miq_task.message}, :error)
    else
      self.x_node = "root" if x_active_tree == :ae_tree && x_tree
      add_flash(_("All custom classes and instances have been reset to default"))
    end
    render :update do |page|          
      page.replace("flash_msg_div", :partial => "layouts/flash_msg")
      page << "miqSparkle(false);"
    end
  end
def reset_datastore unless params [ :task_id ] initiate_wait_for_task ( :task_id => MiqAutomate . async_datastore_reset ) return end miq_task = MiqTask . find ( params [ :task_id ] ) session [ :ae_id ] = params [ :id ] session [ :ae_task_id ] = params [ :task_id ] if miq_task . status != "Ok" add_flash ( _ ( "Error during reset: Status [%{status}] Message [%{message}]" ) % { :status => miq_task . status , :message => miq_task . message } , :error ) else self . x_node = "root" if x_active_tree == :ae_tree && x_tree add_flash ( _ ( "All custom classes and instances have been reset to default" ) ) end render :update do | page | page . replace ( "flash_msg_div" , :partial => "layouts/flash_msg" ) page << "miqSparkle(false);" end end
Reset all custom classes and instances to default
Reset all custom classes and instances to default
# First time thru, kick off the report generate task # Not first time, read the task record # Check to see if any results came back or status not Ok # Use RJS to update the display