chef-notifier 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ === v1.0.1
2
+ * Use pony over mail to avoid conflicts
3
+
4
+ === v1.0.0
5
+ * Initial release
Binary file
@@ -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
- deliver_to = @recipients
38
- unless(Array(deliver_to).empty?)
36
+ if(@args[:recipients])
39
37
  Pony.mail(
40
- :to => deliver_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
 
@@ -13,5 +13,5 @@ module ChefNotifier
13
13
  end
14
14
  end
15
15
 
16
- VERSION = Version.new('1.0.0')
16
+ VERSION = Version.new('1.0.1')
17
17
  end
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Roberts