Skip to content

Commit

Permalink
Default to a 0 evaluation frequncy in dwh alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooli Tayer committed Mar 21, 2017
1 parent 61f45aa commit 67bc09e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 13 additions & 3 deletions app/controllers/miq_policy_controller/alerts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,14 @@ def alert_build_edit_screen
end

def alert_default_repeat_time
(@edit[:new][:expression][:eval_method] && @edit[:new][:expression][:eval_method] == "hourly_performance") ||
@edit[:new][:exp_event] == "_hourly_timer_" ?
1.hour.to_i : 10.minutes.to_i
if (@edit[:new][:expression][:eval_method] && @edit[:new][:expression][:eval_method] == "hourly_performance") ||
@edit[:new][:exp_event] == "_hourly_timer_"
1.hour.to_i
elsif @edit[:new][:expression][:eval_method] && @edit[:new][:expression][:eval_method] == "dwh_generic"
0.minutes.to_i
else
10.minutes.to_i
end
end

def alert_get_perf_column_unit(val)
Expand Down Expand Up @@ -488,6 +493,11 @@ def alert_build_pulldowns
2.hours.to_i => _("2 Hours"), 3.hours.to_i => _("3 Hours"), 4.hours.to_i => _("4 Hours"),
6.hours.to_i => _("6 Hours"), 12.hours.to_i => _("12 Hours"), 1.day.to_i => _("1 Day")
}

# repeat times for Notify Datawarehouse pull down
@sb[:alert][:repeat_times_dwh] ||= {
0.minutes.to_i => _("Always Notify")
}
end

def alert_build_ems_alarms
Expand Down
2 changes: 2 additions & 0 deletions app/views/miq_policy/_alert_details.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@
.col-md-8
- if @edit[:new][:expression][:eval_method] == "hourly_performance"
- repeat = @sb[:alert][:hourly_repeat_times]
- elsif @edit[:new][:expression][:eval_method] == "dwh_generic"
- repeat = @sb[:alert][:repeat_times_dwh]
- else
- repeat = @sb[:alert][:repeat_times]
= select_tag('repeat_time',
Expand Down

0 comments on commit 67bc09e

Please sign in to comment.