Skip to content
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

(PUP-4636) Fix problem with environment.conf parser=future #3958

Conversation

hlindberg
Copy link
Contributor

Before this, when the compiler was instantiated from an environment that
was configured to use parser=current, the initialization of the context
for compilation would do this for parser=current. This led to not having
loaded the ruby code for Puppet::Pops::Loaders, and because of this, the
first function call made in a puppet manifest would fail.

This fixes the problem by making the compiler check if the environment
it is going to set as the current environment has parser=future set
(instead of checking in the current environment).

This also moves the requirement to load the ruby logic to the loading of
'puppet/pops' since the loaders since quite some time back are lazilily
initialized.

Before this, when the compiler was instantiated from an environment that
was configured to use parser=current, the initialization of the context
for compilation would do this for parser=current. This led to not having
loaded the ruby code for Puppet::Pops::Loaders, and because of this, the
first function call made in a puppet manifest would fail.

This fixes the problem by making the compiler check if the environment
it is going to *set* as the current environment has parser=future set
(instead of checking in the current environment).

This also moves the requirement to load the ruby logic to the loading of
'puppet/pops' since the loaders since quite some time back are lazilily
initialized.
@jpartlow
Copy link
Contributor

@hlindberg the future_parser? method is used pretty widely; are there any other cases that might require the environment to be passed in?

@hlindberg
Copy link
Contributor Author

@jpartlow I could not come up with one; it would be code that does what compile does - I am not sure we have any that does not use the compiler to uh... compile. Tests that do not use the compiler are forced to do all required setup on their own.

@puppetcla
Copy link

CLA signed by all contributors.

thallgren added a commit that referenced this pull request May 21, 2015
…etting_not_honoured

(PUP-4636) Fix problem with environment.conf parser=future
@thallgren thallgren merged commit 0cbdf69 into puppetlabs:3.x May 21, 2015
@hlindberg hlindberg deleted the PUP-4636_environment_parser_setting_not_honoured branch September 16, 2017 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants