Issue #21948 has been updated by Henrik Lindberg.
The allowed query expressions (i.e. what is inside the spaceship) is currently quite limited (it may be because of limitations in how the grammar was constructed, or for other historical reasons), and the temptation to play tricks with the few operators that are actually supported is understandable. It is however already troublesome that == is both equality and inclusion as it makes it very difficult to ask for exactly what you want given multi valued attributes in the resource. If making == take on additional meaning, what would it be? ANY?, ALL?, INTERSECT?, A NOT B, B NOT A, etc. In the future parser, the grammar/parser restrictions on what can be understood in the query -expression are gone, and it is a matter of evaluation. This makes it possible to support additional operators like IN. Ideally the query language should be made as competent as Eric Daléns Puppet DB query language. ---------------------------------------- Feature #21948: resource collection == doesn't compare arrays vs arrays https://projects.puppetlabs.com/issues/21948#change-98467 * Author: Jeremy Kitchen * Status: Needs Decision * Priority: Normal * Assignee: eric sorenson * Category: language * Target version: * Affected Puppet version: * Keywords: * Branch: ---------------------------------------- given: <pre> @user { 'foo': groups => ['a','b'], } @user { 'bar': groups => ['b','c'], } </pre> This is what DOES happen: <pre> User<| groups == ['a', 'b'] |> # realizes only user foo User<| groups == 'b' |> # realizes both, as to be expected </pre> So, it would appear that an array on the left hand side is acceptable, but not on the right. This is what I would expect: <pre> User<| groups == ['a','b'] |> # realizes both User<| groups == ['a', 'c'] |> # realizes both </pre> I mainly want this so I can do: </pre> User<| groups == hiera_array('include_groups') |> </pre> I'm using puppet 3.2.3 on both master and agent. I'm not against doing something like: <pre> $include_groups = hiera_array('include_groups') $include_groups.each { | $group | User<| groups == $group |> } </pre> The only problem I have with that is it's experimental and may go away, so I don't want to rely upon that functionality if it may not be there next version. The documentation says it will pull in all resources matching the search key (the right hand operand), which I admittedly initially misread, but the fact that *anything* gets returned makes me wonder if there's more behind this issue. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/groups/opt_out.
