diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-14 11:05:51 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-14 11:05:51 +0000 |
commit | 1e92d64cd3949dc60e06b9aaea80f988143e064f (patch) | |
tree | 0426a438d6b79a365d0fac377904772e6e51d945 /bin/custodian-enqueue | |
parent | 824332eeb4502219c67b232e236a473e09143dc0 (diff) |
Define macros correctly when only one host is present.
Diffstat (limited to 'bin/custodian-enqueue')
-rwxr-xr-x | bin/custodian-enqueue | 21 |
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 |