summaryrefslogtreecommitdiff
path: root/lib/custodian/parser.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-11-20 11:27:36 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-11-20 11:27:36 +0000
commitd44762c6045e4ebac37bbd87887811b65f49e340 (patch)
tree5f843d60264bc930693ee7aa49548c4a89226719 /lib/custodian/parser.rb
parent3b1a261989e87d613fd7963ee73dd83fe5c32aa0 (diff)
Adjusted regexs to be anchored at the beginning of the line, and
expect just one word before "must".
Diffstat (limited to 'lib/custodian/parser.rb')
-rw-r--r--lib/custodian/parser.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/custodian/parser.rb b/lib/custodian/parser.rb
index 913fec7..045711d 100644
--- a/lib/custodian/parser.rb
+++ b/lib/custodian/parser.rb
@@ -257,7 +257,7 @@ class MonitorConfig
elsif ( line =~ /^([0-9A-Z_]+)\s+(is|are)\s+/ )
define_macro( line )
- elsif ( line =~ /(.*)\s+must\s+ping(.*)/ )
+ elsif ( line =~ /^(\S+)\s+must\s+ping(.*)/ )
#
# Ping is a special case because the configuration file entry
@@ -280,7 +280,7 @@ class MonitorConfig
new_line = "#{pre} must run ping #{post}"
return( parse_line( new_line ) )
- elsif ( line =~ /\s+must\s+run\s+([^\s]+)(\s+|\.|$)/i )
+ elsif ( line =~ /^\S+\s+must\s+run\s+([^\s]+)(\s+|\.|$)/i )
#
# Get the service we're testing, and remove any trailing "."