Bug #4357
closedUse of Puppet::Node::Environment.current in template headers breaks on Puppet 3.5/master
Description
e.g. /usr/share/foreman-installer/modules/foreman/templates/_header.erb
module_paths = Puppet::Node::Environment.current[:modulepath].split(':').map{|i| File.expand_path(i) }.join('|')
Produces this error:
[ERROR 2014-02-17 12:45:01 main] Failed to parse template foreman/settings.yaml.erb:
[ INFO 2014-02-17 12:45:01 main] Filepath: (erb)
[ INFO 2014-02-17 12:45:01 main] Line: 4
[ INFO 2014-02-17 12:45:01 main] Detail: undefined method `current' for Puppet::Node::Environment:Class
[ INFO 2014-02-17 12:45:01 main] at /usr/share/foreman-installer/modules/foreman/manifests/config.pp:8 on node foreman-el6.example.com
Affected paths:
- /usr/share/foreman-installer/modules/foreman/templates/_header.erb
- /usr/share/foreman-installer/modules/foreman_proxy/templates/settings.yml.erb
- /usr/share/foreman-installer/modules/puppet/templates/_header.erb
- /usr/share/foreman-installer/modules/puppet/templates/agent/puppet.conf.erb
- /usr/share/foreman-installer/modules/puppet/templates/server/config.ru.erb
- /usr/share/foreman-installer/modules/puppet/templates/server/puppet.conf.erb
Updated by Dominic Cleal almost 11 years ago
- Blocks Tracker #4359: Puppet 3.5.0 support added
Updated by Dominic Cleal almost 11 years ago
Puppet::Context.lookup(:current_environment)
appears to be the way to get the current environment from 3.5.0 onwards.
If we want to keep these headers, that is.
Updated by Dominic Cleal almost 11 years ago
- Due date set to 02/28/2014
- Translation missing: en.field_release set to 7
Updated by Ewoud Kohl van Wijngaarden almost 11 years ago
Does that also work on puppet 2.7? If not, I don't mind dropping the headers.
Updated by Dominic Cleal almost 11 years ago
Ewoud Kohl van Wijngaarden wrote:
Does that also work on puppet 2.7? If not, I don't mind dropping the headers.
No, we'd need to check if the new method is available and fall back otherwise. For example: https://github.com/theforeman/kafo/blob/v0.3.16/lib/kafo/validator.rb#L73-L75
I've had a change committed to Puppet master to keep the existing method, but it prints a deprecation warning, so we should still change.
Updated by Anonymous almost 11 years ago
- Status changed from New to Assigned
- Assignee set to Anonymous
Updated by Anonymous almost 11 years ago
- Status changed from Assigned to Ready For Testing
Updated by Anonymous almost 11 years ago
Missed one module. PR: https://github.com/theforeman/puppet-foreman_proxy/pull/94
Updated by Anonymous almost 11 years ago
- Status changed from Ready For Testing to Closed
Updated by Dominic Cleal almost 11 years ago
- Translation missing: en.field_release changed from 7 to 4
There's now a deprecated compatibility method in Puppet so the installer continues to work, will release instead in 1.5.