Actions
Bug #1516
closedcan not set puppet intervall < 10
Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Description
Hi,
setting puppet_interval in the settings < 10 generates an error in the dashboard
ZeroDivisionError divided by 0 app/helpers/dashboard_helper.rb:8:in `/' app/helpers/dashboard_helper.rb:8:in `count_reports' app/views/dashboard/index.html.erb:40:in `_app_views_dashboard_index_html_erb___575581890_70066262072020_0' app/controllers/dashboard_controller.rb:6:in `index'
app/helpers/dashboard_helper.rb def count_reports(hosts) interval = Setting[:puppet_interval] / 10 _<--- *the error come from this code*_ counter = [] labels = [] start =Time.now.utc - Setting[:puppet_interval].minutes (1..(Setting[:puppet_interval] / interval)).each do now = start + interval.minutes counter << hosts.run_distribution(start, now-1.second).count labels << "#{time_ago_in_words(start.getlocal)}" start = now end {:labels => labels, :counter =>counter} end
Updated by Ohad Levy almost 13 years ago
- Status changed from New to Duplicate
- Target version deleted (
1.0)
Updated by Lucas E Holm over 11 years ago
Bug is still active: Version 1.1stable
Actions