app/controllers/repository_controller.rb
# Refresh all selected or single displayed repo(s)
Refresh all selected or single displayed repo(s)
Refresh all selected or single displayed repo ( s )
def refreshrepos
    assert_privileges("repository_refresh")
    repos = []
    if @lastaction == "show_list" 
      repos = find_checked_items
      if repos.empty?
        add_flash(_("No %{model} were selected for refresh") % {:model => ui_lookup(:tables => "repository")}, :error)
      end
      process_repos(repos, "refresh") unless repos.empty?
      add_flash(_("Refresh initiated for %{count_model} from the CFME Database") %
                  {:count_model => pluralize(repos.length, ui_lookup(:table => "Repository"))}) if @flash_array.nil?
      show_list
      @refresh_partial = "layouts/gtl"
    else 
      if params[:id].nil? || Repository.find_by_id(params[:id]).nil?
        add_flash(_("Repository no longer exists"), :error)
      else
        repos.push(params[:id])
      end
      process_repos(repos, "refresh") unless repos.empty?
      add_flash(_("Refresh initiated for %{count_model} from the CFME Database") %
                  {:count_model => pluralize(repos.length, ui_lookup(:table => "Repository"))}) if @flash_array.nil?
      params[:display] = @display
      show
      if @display == "vms"
        @refresh_partial = "layouts/gtl"
      else
        @refresh_partial = "main"
      end
    end
  end
def refreshrepos assert_privileges ( "repository_refresh" ) repos = [ ] if @lastaction == "show_list" repos = find_checked_items if repos . empty? add_flash ( _ ( "No %{model} were selected for refresh" ) % { :model => ui_lookup ( :tables => "repository" ) } , :error ) end process_repos ( repos , "refresh" ) unless repos . empty? add_flash ( _ ( "Refresh initiated for %{count_model} from the CFME Database" ) % { :count_model => pluralize ( repos . length , ui_lookup ( :table => "Repository" ) ) } ) if @flash_array . nil? show_list @refresh_partial = "layouts/gtl" else if params [ :id ] . nil? || Repository . find_by_id ( params [ :id ] ) . nil? add_flash ( _ ( "Repository no longer exists" ) , :error ) else repos . push ( params [ :id ] ) end process_repos ( repos , "refresh" ) unless repos . empty? add_flash ( _ ( "Refresh initiated for %{count_model} from the CFME Database" ) % { :count_model => pluralize ( repos . length , ui_lookup ( :table => "Repository" ) ) } ) if @flash_array . nil? params [ :display ] = @display show if @display == "vms" @refresh_partial = "layouts/gtl" else @refresh_partial = "main" end end end
Refresh all selected or single displayed repo(s)
Refresh all selected or single displayed repo ( s )
# showing a list, scan all selected repositories # showing 1 repo, refresh it