sensu 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## 0.12.1 - 2013-11-02
2
+
3
+ ### Features
4
+
5
+ API GET `/stashes` now returns stash expiration information, time
6
+ remaining in seconds. eg. [{"path": "foo", "content":{"bar": "baz"},
7
+ "expire": 3598}].
8
+
9
+ ### Other
10
+
11
+ Fixed a config loading bug where Sensu was not ignoring files without a
12
+ valid JSON object.
13
+
14
+ Fixed `handling event` log line data for extensions.
15
+
1
16
  ## 0.12.0 - 2013-10-28
2
17
 
3
18
  ### Non-backwards compatible changes
data/lib/sensu/api.rb CHANGED
@@ -642,17 +642,20 @@ module Sensu
642
642
  unless stashes.empty?
643
643
  stashes.each_with_index do |path, index|
644
644
  $redis.get('stash:' + path) do |stash_json|
645
- unless stash_json.nil?
646
- item = {
647
- :path => path,
648
- :content => Oj.load(stash_json)
649
- }
650
- response << item
651
- else
652
- $redis.srem('stashes', path)
653
- end
654
- if index == stashes.size - 1
655
- body Oj.dump(pagination(response))
645
+ $redis.ttl('stash:' + path) do |ttl|
646
+ unless stash_json.nil?
647
+ item = {
648
+ :path => path,
649
+ :content => Oj.load(stash_json),
650
+ :expire => ttl
651
+ }
652
+ response << item
653
+ else
654
+ $redis.srem('stashes', path)
655
+ end
656
+ if index == stashes.size - 1
657
+ body Oj.dump(pagination(response))
658
+ end
656
659
  end
657
660
  end
658
661
  end
@@ -1,6 +1,6 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
- VERSION = '0.12.0'
3
+ VERSION = '0.12.1'
4
4
 
5
5
  LOG_LEVELS = [:debug, :info, :warn, :error, :fatal]
6
6
 
data/lib/sensu/server.rb CHANGED
@@ -283,7 +283,7 @@ module Sensu
283
283
  log_level = event[:check][:type] == 'metric' ? :debug : :info
284
284
  @logger.send(log_level, 'handling event', {
285
285
  :event => event,
286
- :handler => handler
286
+ :handler => handler.respond_to?(:definition) ? handler.definition : handler
287
287
  })
288
288
  @handlers_in_progress_count += 1
289
289
  on_error = Proc.new do |error|
@@ -84,7 +84,7 @@ module Sensu
84
84
  if File.file?(file) && File.readable?(file)
85
85
  begin
86
86
  contents = File.open(file, 'r').read
87
- config = Oj.load(contents)
87
+ config = Oj.load(contents, :mode => :strict)
88
88
  merged = deep_merge(@settings, config)
89
89
  unless @loaded_files.empty?
90
90
  changes = deep_diff(@settings, merged)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 45
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 12
9
- - 0
10
- version: 0.12.0
9
+ - 1
10
+ version: 0.12.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sean Porter
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-10-28 00:00:00 -07:00
19
+ date: 2013-11-02 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency