Issue #5977 has been updated by Matt Robinson.

Status changed from Available In Testing Branch to Closed


----------------------------------------
Bug #5977: command_line only loads commands from the first path where it finds 
puppet/application directiry
https://projects.puppetlabs.com/issues/5977

Author: Dan Bode
Status: Closed
Priority: Normal
Assignee: 
Category: 
Target version: 2.6.5
Affected Puppet version: 2.6.4
Keywords: 
Branch: https://github.com/bodepd/puppet/tree/ticket/2.6.4/5977


my use case:

I want to write a custom puppet::application

/home/dan/lib/puppet/application/test.rb (extends puppet::application)

now I set RUBYLIB=/home/dan/lib/

now if I run the following:

<pre>
puppet apply
Error: Unknown command apply.
Usage: puppet command <space separated arguments>
Available commands are: test
</pre>


It cannot find the other puppet applications because of the below code from 
'util/command_line.rb'.

<pre>
      def available_subcommands
        absolute_appdir = $LOAD_PATH.collect { |x| 
File.join(x,'puppet','application') }.detect{ |x| File.directory?(x) }
        Dir[File.join(absolute_appdir, '*.rb')].map{|fn| File.basename(fn, 
'.rb')}
      end
</pre>

In only accepts the first dir from LOAD_PATH that has puppet/application (b/c 
the detect call should be select) and ignores the other directories that may 
have applications.

I have a working patch that resolves the issue. I can get it out this weekend.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to