sensu 0.13.0.beta → 0.13.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb0b42351e78060c0d98db18dab7eda10d3454bb
4
- data.tar.gz: d0427f69c4aa2ff78df74388c8fe25db2d4bda37
3
+ metadata.gz: 06c4221b329539aeeca46fd4e8cd4defebc6ca41
4
+ data.tar.gz: 1d97b6669db13f4e5db48a72fb9628777ab4b05c
5
5
  SHA512:
6
- metadata.gz: c018ea24b885b250bd4c34ccadc1b5a96e02c43eaf5ee9671042afb5c4f8d59312ba9ec90477eb69c2161cb20afebdc643fa1f846d78a66bcd5c33f50bfdc55a
7
- data.tar.gz: 2556a259aff1f186d6dc1aa1c61d5799da2bfc88bda700f531b1c52656b67c45b082a777d92cee35971da2b767a5333eeee7238e5e44e57c6dad8053b204c0b5
6
+ metadata.gz: b84ad62f1f09def1515e543787bfbcd19ac1fd994344c7a9c3f9092d5de56041c76b10fc24692f53f2942e918255a3afcf28f03f2eacc74709280116dcc76841
7
+ data.tar.gz: 174bc2ea21a3711708d20ce0525978b3dce08d95566f585311c46b6d3694b804e6daafe41f616ae742cd146b3d364cf9279f2ba8030f6b77c7c9fa2f2567c01f
data/CHANGELOG.md CHANGED
@@ -32,7 +32,8 @@ everything but check extensions.
32
32
 
33
33
  Fixed standalone check scheduling, no longer mutating definitions.
34
34
 
35
- Fixed command token substitution, allowing for the use of colons.
35
+ Fixed command token substitution, allowing for the use of colons and
36
+ working value defaults.
36
37
 
37
38
  Log events are flushed when the eventmachine reactor stops.
38
39
 
data/lib/sensu/client.rb CHANGED
@@ -68,17 +68,20 @@ module Sensu
68
68
  end
69
69
  end
70
70
 
71
+ def find_client_attribute(tree, path, default)
72
+ attribute = tree[path.shift]
73
+ if attribute.is_a?(Hash)
74
+ find_client_attribute(attribute, path, default)
75
+ else
76
+ attribute.nil? ? default : attribute
77
+ end
78
+ end
79
+
71
80
  def substitute_command_tokens(check)
72
81
  unmatched_tokens = Array.new
73
- substituted = check[:command].gsub(/:::([^:]*?):::/) do
82
+ substituted = check[:command].gsub(/:::([^:].*?):::/) do
74
83
  token, default = $1.to_s.split('|', -1)
75
- matched = token.split('.').inject(@settings[:client]) do |client, attribute|
76
- if client[attribute].nil?
77
- default.nil? ? break : default
78
- else
79
- client[attribute]
80
- end
81
- end
84
+ matched = find_client_attribute(@settings[:client], token.split('.'), default)
82
85
  if matched.nil?
83
86
  unmatched_tokens << token
84
87
  end
@@ -1,6 +1,6 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
- VERSION = '0.13.0.beta'
3
+ VERSION = '0.13.0.beta.1'
4
4
 
5
5
  SEVERITIES = %w[ok warning critical unknown]
6
6
 
data/lib/sensu/daemon.rb CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  gem 'multi_json', '1.10.1'
4
4
 
5
- gem 'sensu-em', '2.0.0'
5
+ gem 'sensu-em', '2.1.0'
6
6
  gem 'sensu-logger', '0.0.1'
7
7
  gem 'sensu-settings', '0.0.7'
8
8
  gem 'sensu-extension', '0.0.3'
data/sensu.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.add_dependency('json') if RUBY_VERSION < "1.9"
17
17
  s.add_dependency('multi_json', '1.10.1')
18
18
  s.add_dependency('uuidtools', '2.1.4')
19
- s.add_dependency('sensu-em', '2.0.0')
19
+ s.add_dependency('sensu-em', '2.1.0')
20
20
  s.add_dependency('sensu-logger', '0.0.1')
21
21
  s.add_dependency('sensu-settings', '0.0.7')
22
22
  s.add_dependency('sensu-extension', '0.0.3')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0.beta
4
+ version: 0.13.0.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-28 00:00:00.000000000 Z
12
+ date: 2014-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - '='
47
47
  - !ruby/object:Gem::Version
48
- version: 2.0.0
48
+ version: 2.1.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - '='
54
54
  - !ruby/object:Gem::Version
55
- version: 2.0.0
55
+ version: 2.1.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: sensu-logger
58
58
  requirement: !ruby/object:Gem::Requirement