sensu-plugins-aws 11.4.1 → 11.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0b5dbd2a99985f9529eb58fb7717137fc223d668d763468fad75f00e36bdd2e
4
- data.tar.gz: c91fb2fe947db5c68016d4e5f150e411df6cb21dcf67d2c3e1d64a49faa5af7b
3
+ metadata.gz: 3b4059b3c6a9ba24eab831dae3dc63fc97ebf5ba35f0d89cc89962a7ec86f6b6
4
+ data.tar.gz: 21bb94be580dc82bca8a36e5cc6c777820af8d5deea681d0b761c0e983e52497
5
5
  SHA512:
6
- metadata.gz: 78ac9d20a4b625aae2d445e58f90031d04ff6ae5cbeb4f9e88620c13d9e0795f440418ee638d978e0ae13779761c98531a919aa88f5a3a874f4f45fbf1032753
7
- data.tar.gz: 02896380342abf6b45d48e512b6f396d3248bd97896e9fe9ef4ed005c2e1717cad18c12fd8ded73977d0c3deea2ac8bba4cad2a5a6d51f6dbfce5986507256bb
6
+ metadata.gz: 7b6818bb17139ab28a6876913faea3502b412b484284bc4fa86e4cfa5d92f8db6a07f21b697bd2932a3930ac8fb112c0ef6c5702fa38d04210190a36d01090fc
7
+ data.tar.gz: f3cb83474edecdd41cb3bac7ca0d1c4bc995b007ec2809393633937fd57e1c7cb5543cb298349896510fc3ca372d869b7fca1fa3bf38d0bf877f059b4821be18
@@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
  This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
5
5
 
6
6
  ## [Unreleased]
7
+ ## [11.4.2] - 2018-05-10
8
+ ### Fixed
9
+ - Handle case where a prefix is used and no objects are found. (@akatch)
7
10
 
8
11
  ## [11.4.1] - 2018-05-07
9
12
  ### Fixed
@@ -470,7 +473,8 @@ WARNING: This release contains major breaking changes that will impact all user
470
473
  ### Added
471
474
  - initial release
472
475
 
473
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/11.4.1...HEAD
476
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/11.4.2...HEAD
477
+ [11.4.2]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/11.4.1...11.4.2
474
478
  [11.4.1]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/11.4.0...11.4.1
475
479
  [11.4.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/11.3.1...11.4.0
476
480
  [11.3.1]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/11.3.0...11.3.1
@@ -158,12 +158,16 @@ class CheckS3Object < Sensu::Plugin::Check::CLI
158
158
  elsif !config[:key_prefix].nil?
159
159
  key_search = config[:key_prefix]
160
160
  output = s3.list_objects(bucket: config[:bucket_name], prefix: key_search)
161
- key_fullname = output.contents[0].key
161
+
162
+ if output.contents.size.to_i < 1
163
+ critical "Object with prefix \"#{key_search}\" not found in bucket #{config[:bucket_name]}"
164
+ end
162
165
 
163
166
  if output.contents.size.to_i > 1
164
167
  critical "Your prefix \"#{key_search}\" return too much files, you need to be more specific"
165
168
  end
166
169
 
170
+ key_fullname = output.contents[0].key
167
171
  age = Time.now.to_i - output.contents[0].last_modified.to_i
168
172
  size = output.contents[0].size
169
173
  end
@@ -2,7 +2,7 @@ module SensuPluginsAWS
2
2
  module Version
3
3
  MAJOR = 11
4
4
  MINOR = 4
5
- PATCH = 1
5
+ PATCH = 2
6
6
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.4.1
4
+ version: 11.4.2
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: 2018-05-08 00:00:00.000000000 Z
11
+ date: 2018-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin