diff options
author | David Schmitt <david.schmitt@puppet.com> | 2016-11-29 14:52:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-29 14:52:25 +0000 |
commit | cb59da2359f956e3dccec228e16f6b3aaa6758c4 (patch) | |
tree | 20e5a93377af1e52ac074064065710dfa2aaa682 /lib/puppet | |
parent | 85bdbcf79232f89203b65b9fa1a2e7bc7ddc067a (diff) | |
parent | e501cb1b646e9741fb6f2510a1a3a434041a4d33 (diff) |
Merge pull request #693 from HelenCampbell/moreErrorDetail
(MODULES-3393) Deprecation - Use puppet stacktrace if available
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/functions/deprecation.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/puppet/functions/deprecation.rb b/lib/puppet/functions/deprecation.rb index a860aa2..39d9bc7 100644 --- a/lib/puppet/functions/deprecation.rb +++ b/lib/puppet/functions/deprecation.rb @@ -8,6 +8,12 @@ Puppet::Functions.create_function(:deprecation) do end def deprecation(key, message) + if defined? Puppet::Pops::PuppetStack.stacktrace() + stacktrace = Puppet::Pops::PuppetStack.stacktrace() + file = stacktrace[0] + line = stacktrace[1] + message = "#{message} at #{file}:#{line}" + end # depending on configuration setting of strict case Puppet.settings[:strict] when :off |