The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #14440

Can't get help or man text for instrumentation_* faces via the API

Added by Nick Fagerlund about 2 years ago. Updated almost 2 years ago.

Status:ClosedStart date:05/11/2012
Priority:NormalDue date:
Assignee:Chris Price% Done:

0%

Category:-
Target version:3.0.0
Affected Puppet version: Branch:https://github.com/puppetlabs/puppet/pull/793
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

$ irb
>> require 'puppet/face'
=> true
>> manface=Puppet::Face[:man, '0.0.1']
>> helpface=Puppet::Face[:help, '0.0.1']

>> manface.man("facts")
(whole man page for facts face)

>> manface.man("instrumentation_data")
RuntimeError: Could not find terminus for instrumentation_data
    from /Users/nick/src/puppet/lib/puppet/indirector/face.rb:125:in `indirection'
    from /Users/nick/src/puppet/lib/puppet/face/help/man.erb:123:in `man implementation, required on Ruby 1.8'
    from /Users/nick/src/puppet/lib/puppet/face/man.rb:54:in `man implementation, required on Ruby 1.8'
    from /Users/nick/src/puppet/lib/puppet/interface/action.rb+eval[wrapper]:207:in `__send__'
    from /Users/nick/src/puppet/lib/puppet/interface/action.rb+eval[wrapper]:207:in `man'
    from (irb):5

>> helpface.help("instrumentation_data")
RuntimeError: Could not find terminus for instrumentation_data
    from /Users/nick/src/puppet/lib/puppet/indirector/face.rb:125:in `indirection'
    from /Users/nick/src/puppet/lib/puppet/face/help/face.erb:76:in `help implementation, required on Ruby 1.8'
    from /Users/nick/src/puppet/lib/puppet/face/help.rb:92:in `help implementation, required on Ruby 1.8'
    from /Users/nick/src/puppet/lib/puppet/interface/action.rb+eval[wrapper]:207:in `__send__'
    from /Users/nick/src/puppet/lib/puppet/interface/action.rb+eval[wrapper]:207:in `help'
    from (irb):7

Note that getting man text from the command line works fine; it’s just from the API, and it’s just for the instrumentation_data, instrumentation_probe, and instrumentation_listener faces.


Related issues

Related to Puppet - Refactor #14441: Clean up terrible hack in rake manpages task Accepted 05/11/2012

History

#1 Updated by Chris Price about 2 years ago

This is also triggered by:

rake gen_manpages

Haven’t dug into that yet but I presume that it ends up just executed the exact code that Nick included above.

#2 Updated by Nick Fagerlund about 2 years ago

Yeah, same code.

#3 Updated by Chris Price about 2 years ago

Yup. puppet/tasks/rake/manpages.rake:52:

faces.each do |face|
   File.open("./man/man8/puppet-#{face}.8.ronn", 'w') do |fh|
     fh.write manface.man("#{face}")
   end

   %x{#{ronn} #{ronn_args} ./man/man8/puppet-#{face}.8.ronn}
   FileUtils.rm("./man/man8/puppet-#{face}.8.ronn")
end

#4 Updated by Chris Price about 2 years ago

The problem here is that Puppet::Util::Instrumentation.init() doesn’t get called for the code path that the rake task is executing.

The real problem is that we don’t have an API, and the rake task is trying to use faces as an API even though we haven’t really defined the allowable entry points and initialization steps.

I am investigating to find the least evil spot(s) to call this initialization.

#5 Updated by Chris Price about 2 years ago

I have a fix for this, but it is stupid and it is a hack. I need to create another ticket explaining the larger problem before I am willing to push this up to github.

#6 Updated by Chris Price about 2 years ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Branch set to https://github.com/puppetlabs/puppet/pull/763

#7 Updated by Anonymous about 2 years ago

Awesome. Thanks for the work-around; happy to merge that for now.

#8 Updated by Chris Price about 2 years ago

We’ll need to make sure that this works against master as well, once the 2.7.x changes are merged into master.

#9 Updated by Moses Mendoza about 2 years ago

Released in 2.7.15rc1. Left open for now given Chris' last update.

#10 Updated by Chris Price about 2 years ago

  • Branch changed from https://github.com/puppetlabs/puppet/pull/763 to https://github.com/puppetlabs/puppet/pull/793

added a second pull request that should get this working in master.

#11 Updated by Chris Price about 2 years ago

  • Target version set to 3.0.0

#12 Updated by Jeff Weiss about 2 years ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release

#13 Updated by Matthaus Owens almost 2 years ago

  • Status changed from Merged - Pending Release to Closed

Released in Puppet 3.0.0rc1

Also available in: Atom PDF