124: def list(type, ignore = [], base = nil, format = "yaml", client = nil, clientip = nil)
125: @local = true unless client
126: typeklass = nil
127: unless typeklass = Puppet::Type.type(type)
128: raise Puppet::Error, "Puppet type %s is unsupported" % type
129: end
130:
131:
132: ignore ||= []
133: ignore = [ignore] unless ignore.is_a? Array
134: bucket = Puppet::TransBucket.new
135: bucket.type = typeklass.name
136:
137: typeklass.instances.each do |obj|
138: next if ignore.include? obj.name
139:
140:
141: bucket << obj.to_trans
142: end
143:
144: unless @local
145: case format
146: when "yaml"
147: begin
148: bucket = Base64.encode64(YAML::dump(bucket))
149: rescue => detail
150: Puppet.err detail
151: raise XMLRPC::FaultException.new(
152: 1, detail.to_s
153: )
154: end
155: else
156: raise XMLRPC::FaultException.new(
157: 1, "Unavailable config format %s" % format
158: )
159: end
160: end
161:
162: return bucket
163: end