diff options
| author | Luke Kanies <luke@madstop.com> | 2005-07-31 03:20:59 +0000 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2005-07-31 03:20:59 +0000 |
| commit | edc28424d658396af622ae31ab7e3d23471e229e (patch) | |
| tree | 0d910290c3f70c44d2aced829b7ddbd11cb7cb55 /lib | |
| parent | e041c8a800f61db4ec87f375de77ac4784ff039c (diff) | |
| download | puppet-edc28424d658396af622ae31ab7e3d23471e229e.tar.gz puppet-edc28424d658396af622ae31ab7e3d23471e229e.tar.xz puppet-edc28424d658396af622ae31ab7e3d23471e229e.zip | |
local filebuckets are now tested with files
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@480 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/puppet/type/filebucket.rb | 15 | ||||
| -rw-r--r-- | lib/puppet/type/pfile.rb | 18 |
2 files changed, 23 insertions, 10 deletions
diff --git a/lib/puppet/type/filebucket.rb b/lib/puppet/type/filebucket.rb index 537f3983b..16a323960 100755 --- a/lib/puppet/type/filebucket.rb +++ b/lib/puppet/type/filebucket.rb @@ -1,6 +1,7 @@ -#!/usr/local/bin/ruby -w # An interface for managing filebuckets from puppet +# $Id$ + require 'puppet/filebucket' module Puppet @@ -20,10 +21,10 @@ module Puppet @name = :filebucket @namevar = :name - @@buckets = {} - + # get the actual filebucket object def self.bucket(name) - @@buckets[name] + oname, object = @objects.find { |oname, o| oname == name } + return object.bucket end def initialize(hash) @@ -55,12 +56,10 @@ module Puppet ) end end - - @@buckets[self.name] = @bucket end - end # Puppet::Type::Service - end # Puppet::Type + end + end end # $Id$ diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb index 5dc27290b..dad42c019 100644 --- a/lib/puppet/type/pfile.rb +++ b/lib/puppet/type/pfile.rb @@ -732,21 +732,27 @@ module Puppet :source, :filebucket ] + @paramdoc[:path] = "The path to the file to manage. Must be fully qualified." + @paramdoc[:backup] = "Whether files should be backed up before - being replaced. If a *filebucket* is specified, files will be + being replaced. If a ``filebucket`` is specified, files will be backed up there; else, they will be backed up in the same directory - with a *.puppet-bak* extension." + with a ``.puppet-bak`` extension." + @paramdoc[:linkmaker] = "An internal parameter used by the *symlink* type to do recursive link creation." + @paramdoc[:recurse] = "Whether and how deeply to do recursive management. **false**/*true*/*inf*/*number*" + @paramdoc[:source] = "Where to retrieve the contents of the files. Currently only supports local copying, but will eventually support multiple protocols for copying. Arguments are specified using either a full local path or using a URI (currently only *file* is supported as a protocol)." + @paramdoc[:filebucket] = "A repository for backing up files, including over the network. Currently non-functional." @@ -829,6 +835,14 @@ module Puppet end end + def paramfilebucket=(name) + if bucket = Puppet::Type::PFileBucket.bucket(name) + @parameters[:filebucket] = bucket + else + raise Puppet::Error.new("Could not find filebucket %s" % name) + end + end + def newchild(path, hash = {}) if path =~ %r{^#{File::SEPARATOR}} raise Puppet::DevError.new( |
