Skip to content

(MODULES-3393) Deprecation - Use puppet stacktrace if available #693

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

Merged
merged 2 commits into from
Nov 29, 2016

Conversation

HelenCampbell
Copy link
Contributor

No description provided.

@HelenCampbell HelenCampbell changed the title Deprecation - Use puppet stacktrace if available (MODULES-3393) Deprecation - Use puppet stacktrace if available Nov 23, 2016
@HelenCampbell
Copy link
Contributor Author

A previous PR (#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.

@DavidS
Copy link
Contributor

DavidS commented Nov 23, 2016

Please put the info into the commit message, so it is also available offline.

line = stacktrace[1]
output_message = "#{message} at #{file}:#{line}"
else
output_message = message
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need to use output_message in the failure msg and deprecation warning msg below?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true. as I said on the original PR, re-using the message var would obviate the need to modify the code below, and - in this case - also remove the need fo the else.

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.
Copy link
Contributor

@DavidS DavidS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, this needs more work.

@DavidS DavidS merged commit cb59da2 into puppetlabs:master Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants