~ubuntu-branches/ubuntu/lucid/puppet/lucid-security

« back to all changes in this revision

Viewing changes to lib/puppet/file_serving/terminus_helper.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-12-23 00:48:10 UTC
  • mfrom: (1.1.10 upstream) (3.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091223004810-3i4oryds922g5n59
Tags: 0.25.1-3ubuntu1
* Merge from debian testing.  Remaining changes:
  - debian/rules:
    + Don't start puppet when first installing puppet.
  - debian/puppet.conf, lib/puppet/defaults.rb:
    + Move templates to /etc/puppet
  - lib/puppet/defaults.rb:
    + Fix /var/lib/puppet/state ownership.
  - man/man8/puppet.conf.8: 
    + Fix broken URL in manpage.
  - debian/control:
    + Update maintainer accordint to spec.
    + Puppetmaster Recommends -> Suggests
    + Created puppet-testsuite as a seperate. Allow the users to run puppet's 
      testsuite.
  - tests/Rakefile: Fix rakefile so that the testsuite can acutally be ran.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
# Define some common methods for FileServing termini.
9
9
module Puppet::FileServing::TerminusHelper
10
10
    # Create model instances for all files in a fileset.
11
 
    def path2instances(request, path)
12
 
        args = [:links, :ignore, :recurse].inject({}) { |hash, param| hash[param] = request.options[param] if request.options[param]; hash }
13
 
        Puppet::FileServing::Fileset.new(path, args).files.collect do |file|
14
 
            inst = model.new(File.join(request.key, file), :path => path, :relative_path => file)
 
11
    def path2instances(request, *paths)
 
12
        filesets = paths.collect do |path|
 
13
            # Filesets support indirector requests as an options collection
 
14
            Puppet::FileServing::Fileset.new(path, request)
 
15
        end
 
16
 
 
17
        Puppet::FileServing::Fileset.merge(*filesets).collect do |file, base_path|
 
18
            inst = model.new(base_path, :relative_path => file)
15
19
            inst.links = request.options[:links] if request.options[:links]
 
20
            inst.collect
16
21
            inst
17
22
        end
18
23
    end