Project

General

Profile

Actions

Bug #4357

closed

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

Added by Dominic Cleal almost 11 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
Foreman modules
Target version:
Difficulty:
Triaged:
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 1 (0 open1 closed)

Blocks Installer - Tracker #4359: Puppet 3.5.0 supportClosedDominic Cleal02/17/201402/28/2014

Actions
Actions #1

Updated by Dominic Cleal almost 11 years ago

  • Description updated (diff)
Actions #2

Updated by Dominic Cleal almost 11 years ago

Actions #3

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.

Actions #4

Updated by Dominic Cleal almost 11 years ago

  • Due date set to 02/28/2014
  • Translation missing: en.field_release set to 7
Actions #5

Updated by Ewoud Kohl van Wijngaarden over 10 years ago

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

Actions #6

Updated by Dominic Cleal over 10 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.

Actions #7

Updated by Dominic Cleal over 10 years ago

  • Target version set to 1.9.0
Actions #8

Updated by Anonymous over 10 years ago

  • Status changed from New to Assigned
  • Assignee set to Anonymous
Actions #9

Updated by Anonymous over 10 years ago

  • Status changed from Assigned to Ready For Testing
Actions #10

Updated by Anonymous over 10 years ago

Actions #11

Updated by Anonymous over 10 years ago

  • Status changed from Ready For Testing to Closed
Actions #12

Updated by Dominic Cleal over 10 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.

Actions

Also available in: Atom PDF