Hi everyone, I am trying to simulate the ''grep -v'' behavior in an array: Ex: vgrep([''aaa'',''bbb'',''ccc'',''aaaddd''], ''aaa'') Would return: [''bbb'', ''ccc''] So I tried to use ruby to do it: normally the ''-'' operation should be enough (http://www.ruby-doc.org/core-1.9.3/Array.html#method-i-2D) Here is the code: puppet apply -e '' $my_array=[ "test", "tt" ] $sub_test = [ "tt" ] $result= inline_template("<% my_array-sub_test %>") notice("$my_array") notice("$my_array - $sub_test") notice("$result") '' notice: Scope(Class[main]): testtt notice: Scope(Class[main]): testtt - tt notice: Scope(Class[main]): notice: Finished catalog run in 0.11 seconds So it doesn''t work this way any thoughts? Regards, JM -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi, So it doesn''t work this way any thoughts?>[...] Would that work for you: https://github.com/kwilczynski/puppet-functions/blob/master/lib/puppet/parser/functions/reject.rb ? KW -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/C-1pyK58Q6oJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
thx a lot... it helps On Mon, Mar 19, 2012 at 6:31 PM, Krzysztof Wilczynski < krzysztof.wilczynski@linux.com> wrote:> Hi, > > > So it doesn''t work this way any thoughts? >> > [...] > > Would that work for you: > https://github.com/kwilczynski/puppet-functions/blob/master/lib/puppet/parser/functions/reject.rb? > > KW > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/C-1pyK58Q6oJ. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi, thx a lot... it helps>[...] I do hope that it fulfils your use case :) KW -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/cDL3aXljws0J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi, Just wanted to let you know, that I have added "select.rb" to the "reject.rb", which is the opposite (to some extent). I hope you find them useful :) KW -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/vDzyB_G2zsEJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.