summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-31 16:50:16 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-31 16:50:16 +0000
commit9dc6cf6342a70c83b8422bffa3ada7f9e1e2c538 (patch)
tree7031f1e614897d2687c3a26e0764cba5154a41b4 /lib/puppet
parent7889b0b252b24ff860dbf1a27bc78b928b187ae9 (diff)
downloadpuppet-9dc6cf6342a70c83b8422bffa3ada7f9e1e2c538.tar.gz
puppet-9dc6cf6342a70c83b8422bffa3ada7f9e1e2c538.tar.xz
puppet-9dc6cf6342a70c83b8422bffa3ada7f9e1e2c538.zip
Removing all remnants of the old symlink type
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2133 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/type/pfile.rb24
-rwxr-xr-xlib/puppet/type/pfile/ensure.rb7
-rw-r--r--lib/puppet/type/pfile/target.rb32
3 files changed, 8 insertions, 55 deletions
diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb
index 08d3d5a1a..f87a1e201 100644
--- a/lib/puppet/type/pfile.rb
+++ b/lib/puppet/type/pfile.rb
@@ -109,11 +109,6 @@ module Puppet
end
end
- newparam(:linkmaker) do
- desc "An internal parameter used by the *symlink*
- type to do recursive link creation."
- end
-
newparam(:recurse) do
desc "Whether and how deeply to do recursive
management."
@@ -594,24 +589,7 @@ module Puppet
}
child = nil
- klass = nil
-
- # We specifically look in @parameters here, because 'linkmaker' isn't
- # a valid attribute for subclasses, so using 'self[:linkmaker]' throws
- # an error.
- if @parameters.include?(:linkmaker) and
- args.include?(:source) and ! FileTest.directory?(args[:source])
- klass = Puppet.type(:symlink)
-
- # clean up the args a lot for links
- old = args.dup
- args = {
- :ensure => old[:source],
- :path => path
- }
- else
- klass = self.class
- end
+ klass = self.class
# The child might already exist because 'localrecurse' runs
# before 'sourcerecurse'. I could push the override stuff into
diff --git a/lib/puppet/type/pfile/ensure.rb b/lib/puppet/type/pfile/ensure.rb
index 6f8c335b1..2f1113a13 100755
--- a/lib/puppet/type/pfile/ensure.rb
+++ b/lib/puppet/type/pfile/ensure.rb
@@ -85,12 +85,7 @@ module Puppet
if state = @parent.state(:target)
state.retrieve
- if state.linkmaker
- self.set_directory
- return :directory_created
- else
- return state.mklink
- end
+ return state.mklink
else
self.fail "Cannot create a symlink without a target"
end
diff --git a/lib/puppet/type/pfile/target.rb b/lib/puppet/type/pfile/target.rb
index 17d9bebbc..8b3a25b49 100644
--- a/lib/puppet/type/pfile/target.rb
+++ b/lib/puppet/type/pfile/target.rb
@@ -1,7 +1,5 @@
module Puppet
Puppet.type(:file).newstate(:target) do
- attr_accessor :linkmaker
-
desc "The target for creating a link. Currently, symlinks are the
only type supported."
@@ -47,32 +45,14 @@ module Puppet
end
def retrieve
- if @parent.state(:ensure).should == :directory
- @is = self.should
- @linkmaker = true
- else
- if stat = @parent.stat
- # If we're just checking the value
- if (should = self.should) and
- (should != :notlink) and
- File.exists?(should) and
- (tstat = File.lstat(should)) and
- (tstat.ftype == "directory") and
- @parent.recurse?
- @parent[:ensure] = :directory
- @is = should
- @linkmaker = true
- else
- if stat.ftype == "link"
- @is = File.readlink(@parent[:path])
- @linkmaker = false
- else
- @is = :notlink
- end
- end
+ if stat = @parent.stat
+ if stat.ftype == "link"
+ @is = File.readlink(@parent[:path])
else
- @is = :absent
+ @is = :notlink
end
+ else
+ @is = :absent
end
end
end