summaryrefslogtreecommitdiff
path: root/lib/custodian/parser.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-20 15:52:23 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-20 15:52:23 +0000
commit6e876f8a3c8cc2c3fa7ed48764efa890fc5d8098 (patch)
treef2212c1fe57d0937c1926aea33dd1de428310293 /lib/custodian/parser.rb
parent0ffae8880ed4b667d3a802130ae760bb886512d8 (diff)
Default to a 200-status code check.
Diffstat (limited to 'lib/custodian/parser.rb')
-rw-r--r--lib/custodian/parser.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/custodian/parser.rb b/lib/custodian/parser.rb
index ce6ad1e..b7b4279 100644
--- a/lib/custodian/parser.rb
+++ b/lib/custodian/parser.rb
@@ -428,20 +428,23 @@ class MonitorConfig
#
#
if ( test[:test_type] =~ /^https?/ )
- found = 0
+ #
+ # If a status code is specified use it; otherwise default
+ # to 200.
if ( line =~ /\s+with\s+status\s+([0-9]+)\s+/ )
- test[:http_status]=$1.dup
- found += 1
+ test[:http_status] = $1.dup
+ else
+ test[:http_status] = 200
end
+
+ #
+ # If a content-check is in place then use it.
+ #
if ( line =~ /\s+with\s+content\s+'([^']+)'/ )
test[:http_text]=$1.dup
- found += 1
end
- if ( found == 0 )
- puts "WARNING: Neither an expected text, or a status code, were specified in the line: #{line}"
- end
end