Skip to content

Commit 5ca7207

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

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/puppet/functions/deprecation.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
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+
output_message = "#{message} at #{file}:#{line}"
16+
else
17+
output_message = message
18+
end
1119
# depending on configuration setting of strict
1220
case Puppet.settings[:strict]
1321
when :off

0 commit comments

Comments
 (0)