Class: Status

Inherits:
Application show all
Defined in:
app/controllers/status.rb

Instance Method Summary collapse

Methods inherited from Application

#access_denied, #append_tree, #bad_request?, #binary?, #build_tree, #can_edit_admin?, #cleanup_session, #conflict?, #convert_newline_to_br, #determine_name, #forbidden?, #format_exception, #is_admin?, #is_last_admin?, #list_available_recipes_for, #load_cookbook_segment, #load_environments, #load_session_user, #login_required, #logout_and_redirect_to_login, #not_found?, #redirect_back_or_default, #require_admin, #segment_files, #show_plain_file, #store_location, #str_to_bool, #syntax_highlight

Instance Method Details

#indexObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'app/controllers/status.rb', line 27

def index
  begin
    @status = Chef::Node.list(true)
    if session[:environment]
      @status = Chef::Node.list_by_environment(session[:environment],true)
    else
      @status = Chef::Node.list(true)
    end
    render
  rescue => e
    Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
    @status = {}
    @_message = {:error => "Could not list status"}
    render
  end 
end