fuel-plugin-midonet/deployment_scripts/puppet/modules/plugin_midonet/lib/puppet/parser/functions/filter_nodes.rb

10 lines
199 B
Ruby

module Puppet::Parser::Functions
newfunction(:filter_nodes, :type => :rvalue) do |args|
name = args[1]
value = args[2]
args[0].select do |it|
it[name] == value
end
end
end