summaryrefslogtreecommitdiff
path: root/bin/custodian-enqueue
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
commitceba3e9ebd31f2bac9f0a924df16fc1ee77fdbc9 (patch)
tree0426a438d6b79a365d0fac377904772e6e51d945 /bin/custodian-enqueue
parentffd5ad7166420da9b954d73200f63bc72f066b8f (diff)
Define macros correctly when only one host is present.
Diffstat (limited to 'bin/custodian-enqueue')
-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