sensu-redis 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sensu/redis.rb +5 -1
- data/sensu-redis.gemspec +1 -1
- data/spec/redis_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90aa0b49d4c41c42ff2ff4d1113375a162d09bb6
|
4
|
+
data.tar.gz: de473c8a502f084f9df1b9f3d5f607c7ca86bcd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b124a3ccc401a0b28a5872bb95938d860c2530e831bda4326bb605fefb251703c01fd48b9b21c4a8ed766efe18ca38b0b1ce6f8de8ff943c657a845d66fdc5bc
|
7
|
+
data.tar.gz: 2909f6bc52bafb7f599b812208125efd3fe854f51e70cde09106a68fb99e8d8ea048ec35692324ec54e125abe4865e1b51c7636745486181c150b4877e6c48b8
|
data/lib/sensu/redis.rb
CHANGED
@@ -61,7 +61,11 @@ module Sensu
|
|
61
61
|
end
|
62
62
|
options[:host] ||= "127.0.0.1"
|
63
63
|
options[:port] ||= 6379
|
64
|
-
|
64
|
+
case
|
65
|
+
when options[:sentinels].is_a?(String)
|
66
|
+
raw_urls = options[:sentinels]
|
67
|
+
options[:sentinels] = raw_urls.split(',').map { |url| parse_url(url) }
|
68
|
+
when options[:sentinels].is_a?(Array) && options[:sentinels].length > 0
|
65
69
|
connect_via_sentinel(options, &block)
|
66
70
|
else
|
67
71
|
connect_direct(options, &block)
|
data/sensu-redis.gemspec
CHANGED
data/spec/redis_spec.rb
CHANGED
@@ -25,4 +25,15 @@ describe "Sensu::Redis" do
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
28
|
+
|
29
|
+
it "can connect to a redis master via comma-separated sentinel URL string", :sentinel => true do
|
30
|
+
async_wrapper do
|
31
|
+
Sensu::Redis.connect(:sentinels => "redis://127.0.0.1:26379,redis://127.0.0.1:26379") do |redis|
|
32
|
+
redis.callback do
|
33
|
+
expect(redis.connected?).to eq(true)
|
34
|
+
async_done
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
28
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Porter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|