Issue #5840 has been updated by Daniel Pittman.

Assignee set to Daniel Pittman
Target version set to Telly
Affected Puppet version set to 2.6.0

Ah!  This is actually a limitation of our legacy command line parser.  To make 
unadorned `puppet` work the same as `puppet apply`, we treat anything that 
starts with a dash for the first argument as meaning you want to run `puppet 
apply` - in this case, on the file `data`.

Which leads down this unhelpful path.  We deprecated this invocation model with 
the 2.7.0 release, so we can remove it (by schedule) in 2.8.0, at which point 
we can make this behave nicely, rather than the current behaviour of "being 
terrible and unhelpful".

In the short term, we could try and make the error message from `puppet apply` 
more helpful, but anything more would lead to a compatibility break out of 
sequence.

Sorry not to have updated this sooner.
----------------------------------------
Bug #5840: Util/command_line treats options as applications
https://projects.puppetlabs.com/issues/5840

Author: Luke Kanies
Status: Accepted
Priority: Normal
Assignee: Daniel Pittman
Category: Faces
Target version: Telly
Affected Puppet version: 2.6.0
Keywords: 
Branch: 


Given this command line with a custom application:
<pre>
$ puppet --trace data certificate find foo
</pre>
You get an exception from the 'apply' application, rather than the 'data' 
application:
<pre>
luke@syringe $ puppet --trace data certificate find syringe
/Users/luke/puppet/lib/puppet/application/apply.rb:82:in `main'
/Users/luke/puppet/lib/puppet/application/apply.rb:35:in `run_command'
/Users/luke/puppet/lib/puppet/application.rb:287:in `run'
/Users/luke/puppet/lib/puppet/application.rb:393:in `exit_on_fail'
/Users/luke/puppet/lib/puppet/application.rb:287:in `run'
/Users/luke/puppet/lib/puppet/util/command_line.rb:59:in `execute'
/Users/luke/puppet/bin/puppet:4
Could not run: Could not find file data
luke@syringe $
</pre>
If you move the '--trace' to after 'data', then it works fine.

This should either work (which seems the best choice) or fail with a useful 
error message, rather than loading the wrong application entirely.


-- 
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