/[adm]/puppet/modules/stored_config/lib/puppet/parser/functions/list_exported_ressources.rb
ViewVC logotype

Contents of /puppet/modules/stored_config/lib/puppet/parser/functions/list_exported_ressources.rb

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1350 - (show annotations) (download)
Tue Mar 22 17:27:01 2011 UTC (13 years, 1 month ago) by misc
File size: 586 byte(s)
rename the file, so we have 1 function per file
1 require 'puppet/rails'
2
3 # function :
4 # list_exported_ressources($resource)
5 # -> return a array of title
6
7 module Puppet::Parser::Functions
8 newfunction(:list_exported_ressources, :type => :rvalue) do |args|
9 exported_type = args[0]
10 #TODO manage tags
11 Puppet::Rails.connect()
12 # TODO use find_each
13 return Puppet::Rails::Resource.find(:all,
14 :conditions => { :exported => true,
15 :restype => exported_type }).map { |r| r.title }
16 end
17 end

  ViewVC Help
Powered by ViewVC 1.1.30