puppetlabs/mcollective-puppet-agent — pull request #31 by jantman (2014-06-04 16:15:45+00:00)
Title: MCOP-67 make runall work with compound filters

... by munging the compound filter array to sandwich the user-specified filter inside an and'ed "puppet.enabled()==true" filter

This would be a lot easier if there was a way to get the compound_filter (-S) string from the client, but there doesn't seem to be... it's converted into a filter array by the Matcher before we have access to the client. So, the best I could come up with is to do some rather unsightly array munging on the compound filter array.

This performs the equivalent to sandwiching the user-specified filter between "puppet.enabled()==true and (" and ")"