diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2008-10-06 22:39:56 +0200 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-10-08 11:35:42 +1100 |
commit | c7a6ef2889b0fb2507e5be98a1dd29b69957a216 (patch) | |
tree | ff9362a30364cd063bb37cb6926079a0e60e6402 /lib | |
parent | 3281f2b73ff20d72dca2f6a5063eb1ce23eb4ab2 (diff) | |
download | puppet-c7a6ef2889b0fb2507e5be98a1dd29b69957a216.tar.gz puppet-c7a6ef2889b0fb2507e5be98a1dd29b69957a216.tar.xz puppet-c7a6ef2889b0fb2507e5be98a1dd29b69957a216.zip |
Fix #1202 - Collection attribute matching doesn't parse arrays
This patch allows to do this:
User <| groups == leads |>
@user { "foo":
ensure => "present",
groups => ["bar","baz","leads"]
}
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/parser/ast/collexpr.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/puppet/parser/ast/collexpr.rb b/lib/puppet/parser/ast/collexpr.rb index 3e13d9400..baed325cb 100644 --- a/lib/puppet/parser/ast/collexpr.rb +++ b/lib/puppet/parser/ast/collexpr.rb @@ -30,7 +30,12 @@ class CollExpr < AST::Branch case @oper when "and": code1.call(resource) and code2.call(resource) when "or": code1.call(resource) or code2.call(resource) - when "==": resource[str1] == str2 + when "==": + if resource[str1].is_a?(Array) && form != :exported + resource[str1].include?(str2) + else + resource[str1] == str2 + end when "!=": resource[str1] != str2 end end |