diff options
author | James Turnbull <james@lovedthanlost.net> | 2008-02-08 16:35:06 +1100 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-02-08 16:35:06 +1100 |
commit | c3ead0331adba5f60ea7d508775a89de68e26caa (patch) | |
tree | af3e519a74c3d93986bbad2428a343d7b9bf0b30 /lib/puppet/util/settings.rb | |
parent | f7b0ca9e9475d4b6a9138d70256f143b8ba31f1a (diff) | |
parent | 084d0fb6351ed54ff4c052cff20f21e89063620c (diff) | |
download | puppet-c3ead0331adba5f60ea7d508775a89de68e26caa.tar.gz puppet-c3ead0331adba5f60ea7d508775a89de68e26caa.tar.xz puppet-c3ead0331adba5f60ea7d508775a89de68e26caa.zip |
Merge branch '0.24.x' of git://reductivelabs.com/puppet into 0.24.x
Diffstat (limited to 'lib/puppet/util/settings.rb')
-rw-r--r-- | lib/puppet/util/settings.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb index ff019edb8..cf15d3194 100644 --- a/lib/puppet/util/settings.rb +++ b/lib/puppet/util/settings.rb @@ -509,12 +509,11 @@ class Puppet::Util::Settings objects += add_user_resources(section, obj, done) end + value = obj.value + # Only files are convertable to transportable resources. - next unless obj.respond_to? :to_transportable - next if value(obj.name) =~ /^\/dev/ - next if Puppet::Type::File[obj.value] # skip files that are in our global resource list. + next unless obj.respond_to? :to_transportable and transobjects = obj.to_transportable - transobjects = obj.to_transportable transobjects = [transobjects] unless transobjects.is_a? Array transobjects.each do |trans| # transportable could return nil @@ -1125,7 +1124,7 @@ Generated on #{Time.now}. # the variable 'dir', or adding a slash at the end. def munge(value) # If it's not a fully qualified path... - if value.is_a?(String) and value !~ /^\$/ and value !~ /^\// + if value.is_a?(String) and value !~ /^\$/ and value !~ /^\// and value != 'false' # Make it one value = File.join(Dir.getwd, value) end @@ -1154,12 +1153,15 @@ Generated on #{Time.now}. def to_transportable type = self.type return nil unless type - path = @parent.value(self.name).split(File::SEPARATOR) - path.shift # remove the leading nil - objects = [] path = self.value + return nil unless path.is_a?(String) + return nil if path =~ /^\/dev/ + return nil if Puppet::Type::File[path] # skip files that are in our global resource list. + + objects = [] + # Skip plain files that don't exist, since we won't be managing them anyway. return nil unless self.name.to_s =~ /dir$/ or File.exist?(path) or self.create obj = Puppet::TransObject.new(path, "file") |