sensu-plugins-mailer 2.0.0 → 2.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.
- checksums.yaml +5 -5
- data/CHANGELOG.md +6 -1
- data/bin/handler-mailer.rb +12 -6
- data/lib/sensu-plugins-mailer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8ad181e78c5e2610cd7e1c71df58c691abfd61a79d6a5a0d204be3c9f2678ef3
|
4
|
+
data.tar.gz: d553fba10bcb51805773fbc93a0403b4b020cf39850b35265886d13e2bf44c4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57cf094ec41772b4299865f4ecc5bcf15b9d5ba9a57820511c559516b92b89a975fe03a8b635651a0b1e738f17d87d1e38e7e821d8e0e2ff30baf4bdad3d0fee
|
7
|
+
data.tar.gz: 14a247af62a6d06a6dcfd3e2d9c217246b1315cbe99fdd373903f30e9c1c2105d0760f42b2d7f3c8e5476592f548e7239598376f07a22eb08557d84ce5f1e14e
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [2.0.1] - 2018-01-31
|
9
|
+
### Fixed
|
10
|
+
- handler-mailer.rb: emit an `unknown` with a helpful message when receiving an event `@event['contact']` with multiple objects in an array. This helps avoid confusion over using `contact` when you meant `contacts`. (@majormoses)
|
11
|
+
|
8
12
|
## [2.0.0] - 2017-10-21
|
9
13
|
### Breaking Change
|
10
14
|
- handler-mailer.rb: emit an `unknown` with a helpful message when trying to configure `settings['contact']` with multiple objects. This helps avoid confusion over using `contact` when you meant `contacts`. (@majormoses)
|
@@ -101,7 +105,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
101
105
|
### Added
|
102
106
|
- initial release
|
103
107
|
|
104
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-mailer/compare/
|
108
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-mailer/compare/2.0.1...HEAD
|
109
|
+
[2.0.1]: https://github.com/sensu-plugins/sensu-plugins-mailer/compare/2.0.0...2.0.1
|
105
110
|
[2.0.0]: https://github.com/sensu-plugins/sensu-plugins-mailer/compare/1.2.0...2.0.0
|
106
111
|
[1.2.0]: https://github.com/sensu-plugins/sensu-plugins-mailer/compare/1.1.0...1.2.0
|
107
112
|
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-mailer/compare/1.0.0...1.1.0
|
data/bin/handler-mailer.rb
CHANGED
@@ -135,6 +135,14 @@ class Mailer < Sensu::Handler
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
138
|
+
def raise_contact_is_array(src)
|
139
|
+
msg = "you passed #{src} which is meant to be a string, "
|
140
|
+
msg += 'if you need more than one contact you can use `contacts` to '
|
141
|
+
msg += 'configure multiple recipients'
|
142
|
+
p msg
|
143
|
+
exit 3 # unknown
|
144
|
+
end
|
145
|
+
|
138
146
|
def build_mail_to_list
|
139
147
|
mail_to = Set.new
|
140
148
|
mail_to.add(@event['client']['mail_to'] || json_config_settings['mail_to'])
|
@@ -146,15 +154,13 @@ class Mailer < Sensu::Handler
|
|
146
154
|
end
|
147
155
|
end
|
148
156
|
if settings.key?('contact') && settings['contact'].is_a?(Array)
|
149
|
-
|
150
|
-
msg += 'if you need more than one contact you can use `contacts` to '
|
151
|
-
msg += 'configure multiple recipients'
|
152
|
-
p msg
|
153
|
-
exit 3 # unknown
|
157
|
+
raise_contact_is_array(settings['contact'])
|
154
158
|
elsif settings.key?('contacts')
|
155
159
|
all_contacts = []
|
156
160
|
%w(check client).each do |field|
|
157
|
-
if @event[field].key?('contact')
|
161
|
+
if @event[field].key?('contact') && @event[field]['contact'].is_a?(Array)
|
162
|
+
raise_contact_is_array(@event[field]['contact'])
|
163
|
+
elsif @event[field].key?('contact')
|
158
164
|
all_contacts << @event[field]['contact']
|
159
165
|
end
|
160
166
|
if @event[field].key?('contacts')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-mailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu-Plugins and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-ses
|
@@ -263,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
263
263
|
version: '0'
|
264
264
|
requirements: []
|
265
265
|
rubyforge_project:
|
266
|
-
rubygems_version: 2.
|
266
|
+
rubygems_version: 2.7.4
|
267
267
|
signing_key:
|
268
268
|
specification_version: 4
|
269
269
|
summary: Sensu plugins for mailer
|