Project

General

Profile

Bug #4357

Use of Puppet::Node::Environment.current in template headers breaks on Puppet 3.5/master

Added by Dominic Cleal over 5 years ago. Updated 11 months ago.

Status:
Closed
Priority:
High
Category:
Foreman modules
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

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

Related issues

Blocks Installer - Tracker #4359: Puppet 3.5.0 supportClosed2014-02-172014-02-28

Associated revisions

Revision c8e1f3b6 (diff)
Added by Dmitri Dolguikh about 5 years ago

fixes #4357: Removed template source from the header

Revision 67b71374 (diff)
Added by Dmitri Dolguikh about 5 years ago

fixes #4357: Removed template source from the header

Revision 13d061e6 (diff)
Added by Dmitri Dolguikh about 5 years ago

fixes #4357: Removed template source from the header

History

#1 Updated by Dominic Cleal over 5 years ago

  • Description updated (diff)

#2 Updated by Dominic Cleal over 5 years ago

#3 Updated by Dominic Cleal over 5 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.

#4 Updated by Dominic Cleal over 5 years ago

  • Due date set to 02/28/2014
  • Legacy Backlogs Release (now unused) set to 7

#5 Updated by Ewoud Kohl van Wijngaarden about 5 years ago

Does that also work on puppet 2.7? If not, I don't mind dropping the headers.

#6 Updated by Dominic Cleal about 5 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.

#7 Updated by Dominic Cleal about 5 years ago

  • Target version set to 1.9.0

#8 Updated by Dmitri Dolguikh about 5 years ago

  • Status changed from New to Assigned
  • Assignee set to Dmitri Dolguikh

#11 Updated by Dmitri Dolguikh about 5 years ago

  • Status changed from Ready For Testing to Closed

#12 Updated by Dominic Cleal about 5 years ago

  • Legacy Backlogs Release (now unused) 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.

Also available in: Atom PDF