Opened on 03/26/2014 at 08:35:39 AM

Closed on 03/26/2014 at 12:19:57 PM

#213 closed change (fixed)

Make sure can still parse Puppet files with newer Puppet releases

Reported by: trev Assignee: trev
Priority: P4 Milestone:
Module: Infrastructure Keywords:
Cc: Blocked By:
Blocking: Platform:
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):



We are using the script we are using to push updates to the servers. That script parses manifests/monitoringserver.pp file in order to validate host names and groups. For that it uses Puppet's parser. However, it was written for an older version of Puppet and no longer works with the current versions, producing the following exception:

/Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/parser.rb:2:in `<top (required)>': uninitialized constant Puppet (NameError)

from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
from -:2:in `<main>'

Adding require puppet to the Ruby code we are running here changes the exception to the following:

/Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/settings.rb:315:in `block in convert': Could not parse for environment production: Error converting value for param 'manifest': Error converting value for param 'manifestdir': Could not find value for $confdir (Puppet::Error)

from /Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/settings.rb:306:in `gsub'
from /Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/settings.rb:306:in `convert'
from /Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/settings.rb:1020:in `value'
from /Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/settings.rb:312:in `block in convert'
from /Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/settings.rb:306:in `gsub'
from /Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/settings.rb:306:in `convert'
from /Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/settings.rb:1020:in `value'
from /Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/node/environment.rb:463:in `perform_initial_import'
from /Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/node/environment.rb:216:in `known_resource_types'
from /Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/resource/type_collection_helper.rb:5:in `known_resource_types'
from /Library/Ruby/Gems/2.0.0/gems/puppet-3.4.2/lib/puppet/parser/parser_support.rb:90:in `file='
from -:5:in `<main>'

What to change

Update the Ruby code executed from to support current Puppet versions.

Attachments (0)

Change History (3)

comment:1 Changed on 03/26/2014 at 08:46:21 AM by trev

  • Owner set to trev
  • Status changed from new to assigned

comment:2 Changed on 03/26/2014 at 08:48:33 AM by trev

  • in_progress changed from 0 to 1
  • Review URL(s) modified (diff)
  • Status changed from assigned to reviewing

comment:3 Changed on 03/26/2014 at 12:19:57 PM by trev

  • in_progress changed from 1 to 0
  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from trev.
Note: See TracTickets for help on using tickets.