-
Notifications
You must be signed in to change notification settings - Fork 582
Call site output for deprecation warnings #685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
msg should be named something more obvious, maybe message_and_stracktrace |
or output_message |
b008a75
to
38ff8d6
Compare
@@ -8,15 +8,17 @@ | |||
end | |||
|
|||
def deprecation(key, message) | |||
stacktrace = Puppet::Pops::PuppetStack.stacktrace() | |||
output_message = message + ' - File and Line: ' + stacktrace[0].inspect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-use message
here, saves you editing below.
Also, please format the message as "${message} at ${stacktrace[0][0]}:${stacktrace[0]:[1]}"
to match common conventions on error reporting.
38ff8d6
to
8f8fd4f
Compare
8f8fd4f
to
eac0967
Compare
eac0967
to
64abfc9
Compare
@@ -8,15 +8,19 @@ | |||
end | |||
|
|||
def deprecation(key, message) | |||
stacktrace = Puppet::Pops::PuppetStack.stacktrace() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DavidS I'm sorry I keep doing this to you, but ...
Evaluation Error: Error while evaluating a Function Call, uninitialized constant Puppet::Pops::PuppetStack
https://travis-ci.org/voxpupuli/puppet-gluster/jobs/177770318#L917
That's puppet 3 with future parser enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh, thanks for catching that. I know how that happened: https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/spec/functions/deprecation_spec.rb#L3 is a little too optimistic...
:-(
We'll retry tomorrow.
@DavidS @HelenCampbell @alexjfisher I'm going to revert this PR for now. |
The |
A previous PR (puppetlabs#685) was raised on this issue, however once it was merged it was discovered that Puppet 3 with future parser enabled was calling the Puppet 4 version of the deprecation function. The Puppet stacktrace is not available until Puppet 4.6, so this was breaking existing setups. The solution was to check is the stacktrace was defined, and if it was to use it as part of the message output.
No description provided.