diff options
author | Luke Kanies <luke@madstop.com> | 2009-02-14 11:43:25 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2009-02-14 12:24:42 -0600 |
commit | 44f97aa5815d4a8ab73302bd75b85e045f9944c4 (patch) | |
tree | 13037a58d0666e2533bf85f552327e8a6425f7be /lib/puppet/util | |
parent | 04af7b4ead1cbb1466e908e6612b6cc2d4deab53 (diff) | |
download | puppet-44f97aa5815d4a8ab73302bd75b85e045f9944c4.tar.gz puppet-44f97aa5815d4a8ab73302bd75b85e045f9944c4.tar.xz puppet-44f97aa5815d4a8ab73302bd75b85e045f9944c4.zip |
Only backing up within parsedfile when managing files
I was getting failing tests because I was using non-files
for testing and they didn't back up the same, not
surprisingly.
This moves the 'backup' method to the :flat filetype
and then only backs up if the filetype supports it.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/util')
-rwxr-xr-x | lib/puppet/util/filetype.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/puppet/util/filetype.rb b/lib/puppet/util/filetype.rb index 5d4ba1440..40c028cc2 100755 --- a/lib/puppet/util/filetype.rb +++ b/lib/puppet/util/filetype.rb @@ -72,11 +72,6 @@ class Puppet::Util::FileType @filetypes[type] end - # Back the file up before replacing it. - def backup - bucket.backup(@path) if File.exists?(@path) - end - # Pick or create a filebucket to use. def bucket filebucket = Puppet::Type.type(:filebucket) @@ -90,6 +85,11 @@ class Puppet::Util::FileType # Operate on plain files. newfiletype(:flat) do + # Back the file up before replacing it. + def backup + bucket.backup(@path) if File.exists?(@path) + end + # Read the file. def read if File.exist?(@path) |