summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/log_paths.rb
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2009-12-29 11:29:09 -0800
committerJames Turnbull <james@lovedthanlost.net>2009-12-31 17:55:20 +1100
commit7e2e12be7827c2adb64a192b5b7176c7c541af44 (patch)
treea982203effddaff3250e3a012584b1a1a49c5386 /lib/puppet/util/log_paths.rb
parentc84186ab0736a8e1379294546159d8f6cfec6894 (diff)
downloadpuppet-7e2e12be7827c2adb64a192b5b7176c7c541af44.tar.gz
puppet-7e2e12be7827c2adb64a192b5b7176c7c541af44.tar.xz
puppet-7e2e12be7827c2adb64a192b5b7176c7c541af44.zip
Fix for #2995 (don't fail to load PSON when UTF-8 missing)
We don't actually rely on iconv's UTF-8 support, so its absence shouldn't cause the PSON feature to fail on system (e.g. HPUX) where it isn't fully implemented. This change exposed a dependency on library load order that was causing Puppet::Util::Log to raise an error. I've removed the dependency of Puppet::Type from Puppet::Util::Log. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'lib/puppet/util/log_paths.rb')
-rw-r--r--lib/puppet/util/log_paths.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/puppet/util/log_paths.rb b/lib/puppet/util/log_paths.rb
index 1a6bafc45..46f6c481d 100644
--- a/lib/puppet/util/log_paths.rb
+++ b/lib/puppet/util/log_paths.rb
@@ -11,5 +11,19 @@ module Puppet::Util::LogPaths
return "/" + @path.join("/")
end
+
+ def source_descriptors
+ descriptors = {}
+
+ descriptors[:tags] = tags
+
+ [:path, :file, :line, :version].each do |param|
+ next unless value = send(param)
+ descriptors[param] = value
+ end
+
+ return descriptors
+ end
+
end