Details
-
Task
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
PUP 5.3.3
-
None
-
None
Description
Need to update the how the warn_once() method and issue_deprecation_warning() method prints the file and line location information by using Puppet::Util::Errors.error_location and its i18n friendly output format.
Need to update strings passed to these methods.
def warn_once(kind, key, message, file = nil, line = nil, level = :warning)
|
return if Puppet[:disable_warnings].include?(kind)
|
$unique_warnings ||= {}
|
if $unique_warnings.length < 100 then
|
if (! $unique_warnings.has_key?(key)) then
|
$unique_warnings[key] = message
|
call_trace =
|
case MM.new(file, line)
|
when SUPPRESS_FILE_LINE
|
''
|
when FILE_AND_LINE
|
_("\n (at %{file}:%{line})") % { file: file, line: line }
|
when FILE_NO_LINE
|
_("\n (in %{file})") % { file: file }
|
when NO_FILE_LINE
|
_("\n (in unknown file, line %{line})") % { line: line }
|
else
|
_("\n (file & line not available)")
|
end
|
send_log(level, "#{message}#{call_trace}")
|
end
|
end
|
end
|