diff options
author | Luke Kanies <luke@madstop.com> | 2008-10-27 17:21:21 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-11-04 16:20:45 -0600 |
commit | a4d4444ba216cb3627e03bb45e2eb92424740a44 (patch) | |
tree | 5592e974fc843049a9378541cab3dcd729d1fc9d | |
parent | b4f4866b452cad870e635a8c97e265bd47e3f5ff (diff) | |
download | puppet-a4d4444ba216cb3627e03bb45e2eb92424740a44.tar.gz puppet-a4d4444ba216cb3627e03bb45e2eb92424740a44.tar.xz puppet-a4d4444ba216cb3627e03bb45e2eb92424740a44.zip |
Removing obsolete methods and tests:
Removing obsolete handleignore method
Removing obsolete FileSource class
Removing a now-obsolete test/unit test
Removing a now-obsolete recursive filebucket test
Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r-- | lib/puppet/type/file.rb | 18 | ||||
-rwxr-xr-x | test/ral/type/file.rb | 83 |
2 files changed, 0 insertions, 101 deletions
diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb index 24ffc4a95..922550bd8 100644 --- a/lib/puppet/type/file.rb +++ b/lib/puppet/type/file.rb @@ -439,18 +439,6 @@ module Puppet end end - def handleignore(children) - return children unless self[:ignore] - self[:ignore].each { |ignore| - ignored = [] - Dir.glob(File.join(self[:path],ignore), File::FNM_DOTMATCH) { - |match| ignored.push(File.basename(match)) - } - children = children - ignored - } - return children - end - def initialize(hash) # Store a copy of the arguments for later. tmphash = hash.to_hash @@ -857,12 +845,6 @@ module Puppet end end # Puppet.type(:pfile) - # the filesource class can't include the path, because the path - # changes for every file instance - class ::Puppet::Type::File::FileSource - attr_accessor :mount, :root, :server, :local - end - # We put all of the properties in separate files, because there are so many # of them. The order these are loaded is important, because it determines # the order they are in the property lit. diff --git a/test/ral/type/file.rb b/test/ral/type/file.rb index 255b9e7eb..df0f849f2 100755 --- a/test/ral/type/file.rb +++ b/test/ral/type/file.rb @@ -1223,69 +1223,6 @@ class TestFile < Test::Unit::TestCase assert_equal(:false, file[:replace], ":replace did not alias :false to :no") end - # #365 -- make sure generated files also use filebuckets. - def test_recursive_filebuckets - source = tempfile() - dest = tempfile() - s1 = File.join(source, "1") - sdir = File.join(source, "dir") - s2 = File.join(sdir, "2") - Dir.mkdir(source) - Dir.mkdir(sdir) - [s1, s2].each { |file| File.open(file, "w") { |f| f.puts "yay: %s" % File.basename(file) } } - - sums = {} - [s1, s2].each do |f| - sums[File.basename(f)] = Digest::MD5.hexdigest(File.read(f)) - end - - dfiles = [File.join(dest, "1"), File.join(dest, "dir", "2")] - - bpath = tempfile - bucket = Puppet::Type.type(:filebucket).create :name => "rtest", :path => bpath - dipper = bucket.bucket - dipper = Puppet::Network::Handler.filebucket.new( - :Path => bpath - ) - assert(dipper, "did not receive bucket client") - file = Puppet::Type.newfile :path => dest, :source => source, :recurse => true, :backup => "rtest" - - catalog = mk_catalog(bucket, file) - - catalog.apply - - dfiles.each do |f| - assert(FileTest.exists?(f), "destfile %s was not created" % f) - end - - # Now modify the source files to make sure things get backed up correctly - [s1, s2].each { |sf| File.open(sf, "w") { |f| - f.puts "boo: %s" % File.basename(sf) - } } - - catalog.apply - dfiles.each do |f| - assert_equal("boo: %s\n" % File.basename(f), File.read(f), - "file was not copied correctly") - end - - # Make sure we didn't just copy the files over to backup locations - dfiles.each do |f| - assert(! FileTest.exists?(f + "rtest"), - "file %s was copied for backup instead of bucketed" % File.basename(f)) - end - - # Now make sure we can get the source sums from the bucket - sums.each do |f, sum| - result = nil - assert_nothing_raised do - result = dipper.getfile(sum) - end - assert(result, "file %s was not backed to filebucket" % f) - assert_equal("yay: %s\n" % f, result, "file backup was not correct") - end - end - def test_backup path = tempfile() file = Puppet::Type.newfile :path => path, :content => "yay" @@ -1470,26 +1407,6 @@ class TestFile < Test::Unit::TestCase "did not default to a filebucket for backups") end - # #515 - make sure 'ensure' other than "link" is deleted during recursion - def test_ensure_deleted_during_recursion - dir = tempfile() - Dir.mkdir(dir) - file = File.join(dir, "file") - File.open(file, "w") { |f| f.puts "asdfasdf" } - - obj = Puppet::Type.newfile(:path => dir, :ensure => :directory, - :recurse => true) - - catalog = mk_catalog(obj) - children = nil - assert_nothing_raised do - children = obj.eval_generate - end - fobj = catalog.resource(:file, file) - assert(fobj, "did not create file object") - assert(fobj.should(:ensure) != :directory, "ensure was passed to child") - end - # #567 def test_missing_files_are_in_sync file = tempfile |