Class: StatusNotifierHandler
- Inherits:
-
Chef::Handler
- Object
- Chef::Handler
- StatusNotifierHandler
- Defined in:
- lib/chef/handler/status_notifier.rb
Constant Summary collapse
- DEFAULT_FAILED_MESSAGE =
'"Failure on #{node.name}: #{run_status.formatted_exception}"'.freeze
- DEFAULT_SUCCESS_MESSAGE =
'"Chef run succesfully on #{node.name}"'.freeze
Instance Method Summary collapse
-
#initialize(slack_params, hipchat_params, custom_message_params = {}) ⇒ StatusNotifierHandler
constructor
A new instance of StatusNotifierHandler.
- #report ⇒ Object
Constructor Details
#initialize(slack_params, hipchat_params, custom_message_params = {}) ⇒ StatusNotifierHandler
Returns a new instance of StatusNotifierHandler.
15 16 17 18 19 |
# File 'lib/chef/handler/status_notifier.rb', line 15 def initialize(slack_params, hipchat_params, = {}) @slack_params = slack_params @hipchat_params = hipchat_params = end |
Instance Method Details
#report ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/chef/handler/status_notifier.rb', line 21 def report if run_status.failed? msg = status = :failed else msg = status = :success end send_to_slack(node.name, status, msg) send_to_hipchat(msg) end |