[PUP-5835] Symbol in scope; puppet apply -e 'notify { $environment: }' raises an exception Created: 2016/02/07  Updated: 2016/04/27  Resolved: 2016/02/11

Status: Closed
Project: Puppet
Component/s: None
Affects Version/s: PUP 4.3.2
Fix Version/s: PUP 4.4.0

Type: Bug Priority: Normal
Reporter: Kylo Ginsberg Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by PUP-5841 Environment string matching in the pa... Closed
Template:
Story Points: 1
Sprint: Language 2016-02-10, Language 2016-02-24
Release Notes: Bug Fix
Release Notes Summary: The $enviroment variable in 4.3.2 ended up as a Ruby symbol instead of being a String. A work around is to interpolate it {{"$environment"}}.

 Comments   
Comment by Kylo Ginsberg [ 2016/02/07 ]

I bisected this to https://github.com/puppetlabs/puppet/commit/14b138a14740bb9b7931a050e822543a98ef02f6.

Note to Henrik Lindberg: this is in the same area where we ran into a puppet 4.3.2 incompatibility with rspec-puppet 2.3.0.

Comment by Henrik Lindberg [ 2016/02/07 ]

So that one is probably easy to fix as the node adds its parameters and environment to the scope - IIRC they are not looked up from the node object, they are actually bound to names in the scope.

Comment by Henrik Lindberg [ 2016/02/07 ]

yeah, it is a 1/2-line fix

Actually it was a few line more when doing it right. PR is up with tests to prevent a regression in the area of node parameters end up in scope as symbols.

Comment by Sean Griffin [ 2016/02/11 ]

Verified by hand on stable. Created a test rail entry which points to the new unit test identified in the PR.

[root@r2h3vx0fque2zwn ~]# puppet apply -e 'notify { $environment: }'
Notice: Compiled catalog for r2h3vx0fque2zwn.delivery.puppetlabs.net in environment production in 0.03 seconds
Notice: production
Notice: /Stage[main]/Main/Notify[production]/message: defined 'message' as 'production'
Notice: Applied catalog in 0.01 seconds

Generated at Mon Jan 27 09:53:12 PST 2020 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.