only set email alerts if node[:monit][:notify_email] is not nil (defaults to nil) #20

Merged
merged 1 commit into from Sep 10, 2014

Conversation

Projects
None yet
4 participants
Contributor

anujbiyani commented Jan 29, 2013

Sometimes (for example in test environments), I don't want Monit to send email alerts.

I also added tests with ChefSpec; it's a cool RSpec-based unit-testing framework for cookbooks.

This would be pretty nifty!

miry commented Oct 31, 2013

Why do we need to add more attributes? What do you think to check node[:monit][:notify_email], if it is empty or nil don't setup alert?

Contributor

anujbiyani commented Oct 31, 2013

Hmm good point; I'll change it.

Contributor

anujbiyani commented Oct 31, 2013

I changed the default value of node[:monit][:notify_email] to be nil; I think this is okay because setting it to notify@example.com won't work anyway.

Also updated ChefSpec (relative to my first commit) and updated the syntax used in my specs.

Let me know if you want anything else changed, or my commits squashed, or ChefSpec removed.

@yyamano yyamano added a commit to OGIS-RI-EOS/monit that referenced this pull request Dec 8, 2013

@yyamano yyamano No email configuration if node[:monit][:notify_email] is nil or blank.
Based on @anujbiyani work on issue #20
b72eff0
Contributor

anujbiyani commented Mar 24, 2014

Rebased my branch on master.

Collaborator

yourabi commented Sep 10, 2014

Hi @anujbiyani - could you please rebase again and I'll merge as soon as you do that.

anujbiyani changed the title from only set email alerts if node[:monit][:email_alerts?] is true (defaults to true) to only set email alerts if node[:monit][:notify_email] is not nil (defaults to nil) Sep 10, 2014

anujbiyani referenced this pull request Sep 10, 2014

Merged

fix the specs #59

Contributor

anujbiyani commented Sep 10, 2014

Rebased.

Collaborator

yourabi commented Sep 10, 2014

Thanks!

@yourabi yourabi added a commit that referenced this pull request Sep 10, 2014

@yourabi yourabi Merge pull request #20 from Lytro/make_email_alerts_optional
only set email alerts if node[:monit][:notify_email] is not nil (defaults to nil)
7c0c2d7

@yourabi yourabi merged commit 7c0c2d7 into apsoto:master Sep 10, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment