Skip to content

Commit be54a4f

Browse files
author
Helen Campbell
committed
Deprecation - Use puppet stacktrace if available
1 parent 419f7d6 commit be54a4f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/puppet/functions/deprecation.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
end
99

1010
def deprecation(key, message)
11+
if defined? Puppet::Pops::PuppetStack.stacktrace()
12+
stacktrace = Puppet::Pops::PuppetStack.stacktrace()
13+
file = stacktrace[0]
14+
line = stacktrace[1]
15+
message << " at #{file}:#{line}"
16+
end
1117
# depending on configuration setting of strict
1218
case Puppet.settings[:strict]
1319
when :off

0 commit comments

Comments
 (0)