diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-08-29 00:23:40 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-08-29 00:23:40 +0000 |
| commit | 762599b73c0fa4e04a9e7a7048d99b7223056b47 (patch) | |
| tree | e9312ea6a1da1f6237792d85a23f91a7292eeb60 /lib | |
| parent | 0674c9a567e3453ae6b2d3746c0ecde29a68329e (diff) | |
| download | puppet-762599b73c0fa4e04a9e7a7048d99b7223056b47.tar.gz puppet-762599b73c0fa4e04a9e7a7048d99b7223056b47.tar.xz puppet-762599b73c0fa4e04a9e7a7048d99b7223056b47.zip | |
Fixing tagmail config processing so it fails when appropriate
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1509 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/puppet/reports/tagmail.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/puppet/reports/tagmail.rb b/lib/puppet/reports/tagmail.rb index b6593939c..4a53e2f3a 100644 --- a/lib/puppet/reports/tagmail.rb +++ b/lib/puppet/reports/tagmail.rb @@ -23,11 +23,19 @@ Puppet::Server::Report.newreport(:tagmail) do |report| # Load the config file tags = {} File.readlines(Puppet[:tagmap]).each do |line| - taglist, emails = line.chomp.split(/\s*:\s*/) + taglist = emails = nil + case line.chomp + when /^\s*#/: next + when /^\s*$/: next + when /^\s*(.+)\s*:\s*(.+)\s*$/: + taglist = $1 + emails = $2 + else + raise ArgumentError, "Invalid tagmail config file" + end - emails = emails.split(/\s*,\s*/) taglist.split(/\s*,\s*/).each do |tag| - tags[tag] = emails + tags[tag] = emails.split(/\s*,\s*/) end end |
