diff options
| author | Luke Kanies <luke@madstop.com> | 2008-02-12 17:37:51 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-02-12 17:37:51 -0600 |
| commit | da78d96cb139db0775e634b2fa4bd9c173752127 (patch) | |
| tree | 4139d3a2011baedb171a8307c4830c5ac3fe3625 /lib/puppet/util/settings.rb | |
| parent | bee9aba2da453151a80c6e1f25f16bec3bfde8d2 (diff) | |
| parent | 3af6827875f4e02b47fe2293280ff9afe811485f (diff) | |
| download | puppet-da78d96cb139db0775e634b2fa4bd9c173752127.tar.gz puppet-da78d96cb139db0775e634b2fa4bd9c173752127.tar.xz puppet-da78d96cb139db0775e634b2fa4bd9c173752127.zip | |
Merge branch '0.24.x'
Conflicts:
CHANGELOG
Diffstat (limited to 'lib/puppet/util/settings.rb')
| -rw-r--r-- | lib/puppet/util/settings.rb | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb index f87f96980..2c8fc682a 100644 --- a/lib/puppet/util/settings.rb +++ b/lib/puppet/util/settings.rb @@ -421,19 +421,19 @@ class Puppet::Util::Settings objects += add_user_resources(section, obj, done) end + value = obj.value + # Only files are convertable to transportable resources. - if obj.respond_to? :to_transportable - next if value(obj.name) =~ /^\/dev/ - transobjects = obj.to_transportable - transobjects = [transobjects] unless transobjects.is_a? Array - transobjects.each do |trans| - # transportable could return nil - next unless trans - unless done[:file].include? trans.name - @created << trans.name - objects << trans - done[:file][trans.name] = trans - end + next unless obj.respond_to? :to_transportable and transobjects = obj.to_transportable + + transobjects = [transobjects] unless transobjects.is_a? Array + transobjects.each do |trans| + # transportable could return nil + next unless trans + unless done[:file].include? trans.name + @created << trans.name + objects << trans + done[:file][trans.name] = trans end end end @@ -1036,7 +1036,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 @@ -1065,12 +1065,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") |
