Project

General

Profile

Actions

Bug #1516

closed

can not set puppet intervall < 10

Added by Florian Koch almost 13 years ago. Updated over 11 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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


Related issues 1 (0 open1 closed)

Is duplicate of Foreman - Bug #1475: Can't set the puppet_run interval to less than 10.Resolved01/29/2012Actions
Actions

Also available in: Atom PDF