Ask Your Question
0

Expected String, got Runtime[ruby, Symbol] for $environment in 4.3.2

asked 2016-02-01 05:23:44 -0500

jon6000 gravatar image

I noticed a change in the way $environment is handled in Puppet 4.3.2, I now have to enclose it in quotation marks in order for it to be handled as a String.

4.3.1:

root@localdev:~# puppet apply -e 'notify { $environment: }'
Notice: Compiled catalog for xxx in environment local in 0.04 seconds
Notice: local

4.3.2:

root@localdev:~# puppet apply -e 'notify { $environment: }'
Error: Evaluation Error: Illegal title type at index 0. Expected String, got Runtime[ruby, Symbol]  at line 1:10 on node xxx

root@localdev:~# puppet apply -e 'notify { "${environment}": }'
Notice: Compiled catalog for xxx in environment local in 0.04 seconds
Notice: local
Notice: /Stage[main]/Main/Notify[local]/message: defined 'message' as 'local'
Notice: Applied catalog in 0.43 seconds

Is this expected behaviour? If so I will modify my scripts accordingly to use double quotes.

Thanks,

Jon

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-02-07 17:13:50 -0500

Henrik Lindberg gravatar image

And problem fixed and will appear in the next release.

As a workaround do use string interpolation until getting a fixed version; either Puppet 4.3.3, or 4.4.0, whichever comes first.

edit flag offensive delete link more
0

answered 2016-02-07 14:37:08 -0500

kylog gravatar image

This strikes me as an unintended regression. I filed https://tickets.puppetlabs.com/browse... to track the issue further.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-02-01 05:23:44 -0500

Seen: 124 times

Last updated: Feb 01 '16