sensu-settings 1.1.0 → 1.2.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/settings/validators/check.rb +2 -14
- data/sensu-settings.gemspec +1 -1
- data/spec/validator_spec.rb +2 -5
- 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: a5afc7c7ef4a3cfc41e5a052c2133371dade84f1
|
4
|
+
data.tar.gz: 2345400d3a76e5b7b275866baf577f52875bc4e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daa43044a9e2ac530ea62f613ebe86aefaf2b734a499f4c8b098c8b5e0480041e099c2d31cd8489791894d94745941a7c950bf627544363cf4dc9f2e3c7487fe
|
7
|
+
data.tar.gz: a95609dba6b6631c75be0d20d0c1d454386d0bc8969912cef9005abd7c91bfc412efd507c0510a75cbfeb03ca5f52c6e539b8f3ac224959dde1e2555587751fd
|
@@ -53,17 +53,6 @@ module Sensu
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
# Validate check masquerade.
|
57
|
-
# Validates: masquerade
|
58
|
-
#
|
59
|
-
# @param check [Hash] sensu check definition.
|
60
|
-
def validate_check_masquerade(check)
|
61
|
-
must_be_a_string(check[:masquerade]) ||
|
62
|
-
invalid(check, "check masquerade must be a string")
|
63
|
-
must_match_regex(/^[\w\.-]+$/, check[:masquerade]) ||
|
64
|
-
invalid(check, "check masquerade cannot contain spaces or special characters")
|
65
|
-
end
|
66
|
-
|
67
56
|
# Validate a Sensu check definition.
|
68
57
|
#
|
69
58
|
# @param check [Hash] sensu check definition.
|
@@ -76,12 +65,11 @@ module Sensu
|
|
76
65
|
invalid(check, "check command must be a string")
|
77
66
|
must_be_a_numeric_if_set(check[:timeout]) ||
|
78
67
|
invalid(check, "check timeout must be numeric")
|
68
|
+
must_be_a_string_if_set(check[:source]) ||
|
69
|
+
invalid(check, "check source must be a string")
|
79
70
|
validate_check_scheduling(check)
|
80
71
|
validate_check_handling(check)
|
81
72
|
validate_check_flap_detection(check)
|
82
|
-
if check[:masquerade]
|
83
|
-
validate_check_masquerade(check)
|
84
|
-
end
|
85
73
|
if check[:subdue]
|
86
74
|
validate_subdue(check)
|
87
75
|
end
|
data/sensu-settings.gemspec
CHANGED
data/spec/validator_spec.rb
CHANGED
@@ -141,13 +141,10 @@ describe "Sensu::Settings::Validator" do
|
|
141
141
|
check[:high_flap_threshold] = 55
|
142
142
|
@validator.validate_check(check)
|
143
143
|
expect(@validator.reset).to eq(0)
|
144
|
-
check[:
|
145
|
-
@validator.validate_check(check)
|
146
|
-
expect(@validator.reset).to eq(2)
|
147
|
-
check[:masquerade] = "%&@*"
|
144
|
+
check[:source] = 1
|
148
145
|
@validator.validate_check(check)
|
149
146
|
expect(@validator.reset).to eq(1)
|
150
|
-
check[:
|
147
|
+
check[:source] = "switch-%42%"
|
151
148
|
@validator.validate_check(check)
|
152
149
|
expect(@validator.reset).to eq(0)
|
153
150
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-settings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.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: 2014-09-
|
11
|
+
date: 2014-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|