Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Coremunity
-
1
-
Platform Core KANBAN
-
Needs Assessment
-
Bug Fix
-
The "puppet help" command no longer displays the "--extra" command line option, as it is not functional.
-
Needs Assessment
Description
Puppet Version: 5.5.1
Puppet Server Version: N/A
OS Name/Version: Centos 7.4.1708
Many `puppet` applications such as `puppet facts` and `puppet catalog` take a `–terminus` option to specify what indirector to use. These applications generally also specify a `–extra` argument, like so:
`--extra HASH - Extra arguments to pass to the indirection request`
As far as I can determine, this argument is not actually possible to use, since any argument supplied to the `–extra` option is treated by Ruby as a String. For example, `puppet facts --terminus network_device --extra '{target => "example-device"}'` results in `Error: Could not call 'find' on 'facts': undefined method `inject' for "{target => \"example-device\"}":String`
The same results are had when trying other hash-ish syntaxes such as JSON or key-value pairs.
If there's some existing syntax that will actually work here, it should be documented. But I had a look through the source code, and I don't think any such syntax exists.
Describe steps to reproduce…
`puppet facts --terminus network_device --extra <anything at all here>`
Desired Behavior:
**The `–extra` argument should function, or should be removed.
Actual Behavior:
```
$ sudo puppet facts --terminus network_device --extra '{target => "example-device"}' --trace
Error: Could not call 'find' on 'facts': undefined method `inject' for "{target => \"example-device\"}":String
Did you mean? inspect
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/request.rb:68:in `initialize'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:115:in `new'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:115:in `request'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:187:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/face.rb:46:in `call_indirection_method'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/face.rb:84:in `block (2 levels) in <class:Face>'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/interface/action.rb+eval[wrapper]:264:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/face_base.rb:247:in `main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:383:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:661:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:137:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:73:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
Error: Could not call 'find' on 'facts': undefined method `inject' for "{target => \"example-device\"}":String
Did you mean? inspect
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/request.rb:68:in `initialize'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:115:in `new'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:115:in `request'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:187:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/face.rb:46:in `call_indirection_method'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/face.rb:84:in `block (2 levels) in <class:Face>'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/interface/action.rb+eval[wrapper]:264:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/face_base.rb:247:in `main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:383:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:661:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:137:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:73:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
Error: Try 'puppet help facts find' for usage
```