chef-notifier 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +5 -0
- data/chef-notifier-1.0.0.gem +0 -0
- data/lib/chef-notifier/mail.rb +4 -4
- data/lib/chef-notifier/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.rdoc
CHANGED
Binary file
|
data/lib/chef-notifier/mail.rb
CHANGED
@@ -10,7 +10,6 @@ module ChefNotifier
|
|
10
10
|
|
11
11
|
def setup(args={})
|
12
12
|
@args = {:delivery => {:method => :sendmail, :arguments => '-i'}}.merge(args)
|
13
|
-
@recipients = Array(@args[:recipients])
|
14
13
|
end
|
15
14
|
|
16
15
|
def report
|
@@ -34,10 +33,9 @@ module ChefNotifier
|
|
34
33
|
private
|
35
34
|
|
36
35
|
def send_mail(message, subject=nil)
|
37
|
-
|
38
|
-
unless(Array(deliver_to).empty?)
|
36
|
+
if(@args[:recipients])
|
39
37
|
Pony.mail(
|
40
|
-
:to =>
|
38
|
+
:to => @args[:recipients],
|
41
39
|
:subject => subject || "[Chef ERROR #{Socket.gethostname}]",
|
42
40
|
:from => "chef-client@#{Socket.gethostname}",
|
43
41
|
:body => message,
|
@@ -45,6 +43,8 @@ module ChefNotifier
|
|
45
43
|
:arguments => @args[:delivery][:arguments]
|
46
44
|
}
|
47
45
|
)
|
46
|
+
else
|
47
|
+
Chef::Log.warn 'Failed to send notification email. No recipients found provided.'
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Roberts
|