diff options
author | Luke Kanies <luke@madstop.com> | 2008-02-07 15:31:43 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-02-07 15:31:43 -0600 |
commit | 2931723bae9e4226ab8eb7f6f806bf9a2ea5cbb8 (patch) | |
tree | 97faf9a4fe67acc739fd2ecc9ef2e483feac61cf /lib/puppet/util/settings.rb | |
parent | f19e106b5ee0eab0ca0de2f441073b37540f3e8f (diff) | |
download | puppet-2931723bae9e4226ab8eb7f6f806bf9a2ea5cbb8.tar.gz puppet-2931723bae9e4226ab8eb7f6f806bf9a2ea5cbb8.tar.xz puppet-2931723bae9e4226ab8eb7f6f806bf9a2ea5cbb8.zip |
Fixing the Settings class so that it correctly handles
file values that are false.
Diffstat (limited to 'lib/puppet/util/settings.rb')
-rw-r--r-- | lib/puppet/util/settings.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb index ff019edb8..c84a5bfb1 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 @@ -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") |