Skip to content

Commit b008a75

Browse files
author
Helen Campbell
committed
Call site display for deprecation warnings
1 parent 4b15c97 commit b008a75

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/puppet/functions/deprecation.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@
88
end
99

1010
def deprecation(key, message)
11+
stacktrace = Puppet::Pops::PuppetStack.stacktrace()
12+
msg = message + ' - File and Line: ' + stacktrace[0].inspect
1113
# depending on configuration setting of strict
1214
case Puppet.settings[:strict]
1315
when :off
1416
# do nothing
1517
when :error
16-
fail("deprecation. #{key}. #{message}")
18+
fail("deprecation. #{key}. #{msg}")
1719
else
1820
unless ENV['STDLIB_LOG_DEPRECATIONS'] == 'false'
19-
Puppet.deprecation_warning(message, key)
21+
Puppet.deprecation_warning(msg, key)
2022
end
2123
end
2224
end

0 commit comments

Comments
 (0)