Project

General

Profile

« Previous | Next » 

Revision e07a21c9

Added by Sam Kottler over 10 years ago

fixes #3261 - use the action the host is about to perform for power action notifications

View differences:

app/controllers/hosts_controller.rb
def power
return invalid_request unless PowerManager::SUPPORTED_ACTIONS.include?(params[:power_action])
@host.power.send(params[:power_action].to_sym)
process_success :success_redirect => :back, :success_msg => _("%{host} is now %{state}") % { :host => @host, :state => _(@host.power.state) }
process_success :success_redirect => :back, :success_msg => _("%{host} is about to %{action}") % { :host => @host, :action => _(params[:power_action].downcase) }
rescue => e
process_error :redirect => :back, :error_msg => _("Failed to %{action} %{host}: %{e}") % { :action => _(params[:power_action]), :host => @host, :e => e }
end

Also available in: Unified diff