summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-14 11:05:51 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-14 11:05:51 +0000
commit1e92d64cd3949dc60e06b9aaea80f988143e064f (patch)
tree0426a438d6b79a365d0fac377904772e6e51d945
parent824332eeb4502219c67b232e236a473e09143dc0 (diff)
Define macros correctly when only one host is present.
-rwxr-xr-xbin/custodian-enqueue21
1 files changed, 17 insertions, 4 deletions
diff --git a/bin/custodian-enqueue b/bin/custodian-enqueue
index 4678562..9a261b7 100755
--- a/bin/custodian-enqueue
+++ b/bin/custodian-enqueue
@@ -209,13 +209,26 @@ class MonitorConfig
elsif ( line =~ /\s(is|are)\s+(.*)\.+$/ )
#
- # Literal list.
+ # Literal list of hosts
#
- tmp = $2.dup.split( /\s+and\s+/ )
- tmp.each do |entry|
- val.push( entry )
+ hosts = $2.dup
+
+ #
+ # If there is " and " then tokenize
+ #
+ if ( hosts =~ /\s+and\s+/ )
+ tmp = hosts.split( /\s+and\s+/ )
+ tmp.each do |entry|
+ val.push( entry )
+ end
+ else
+ #
+ # Otherwise a single host
+ #
+ val.push( hosts )
end
+
end
@MACROS[name] = val