Jira (PUP-8700) --extra cli option is nonfunctional

16 views
Skip to first unread message

Adam Gardner (JIRA)

unread,
May 4, 2018, 7:53:02 PM5/4/18
to puppe...@googlegroups.com
Adam Gardner created an issue
 
Puppet / Bug PUP-8700
--extra cli option is nonfunctional
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2018/05/04 4:52 PM
Labels: commandline
Priority: Minor Minor
Reporter: Adam Gardner

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

```

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
May 5, 2018, 7:43:02 AM5/5/18
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-8700
 
Re: --extra cli option is nonfunctional

It may be that the code internally uses the extra arguments feature and that it cannot really be removed.

Josh Cooper (JIRA)

unread,
May 7, 2018, 12:17:02 PM5/7/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Team: Coremunity

Josh Cooper (JIRA)

unread,
May 7, 2018, 12:17:02 PM5/7/18
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-8700
 
Re: --extra cli option is nonfunctional

Faces never attempts to parse the argument into a hash, so it's never going to work from the command line. I'm not sure if any faces rely on being able to do this programmatically. Probably best to just remove it from the CLI help output.

Josh Cooper (Jira)

unread,
Jun 15, 2021, 1:35:03 PM6/15/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-8700

I reopened this one and close the other, since this one is more general about how extra doesn't work for any face application.

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 15, 2021, 3:01:02 PM6/15/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Platform Core KANBAN

Josh Cooper (Jira)

unread,
Jun 15, 2021, 3:01:02 PM6/15/21
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Josh Cooper
Change By: Josh Cooper
Assignee: Josh Cooper

Josh Cooper (Jira)

unread,
Jun 16, 2021, 11:38:01 AM6/16/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.9.0
Fix Version/s: PUP 6.24.0

Josh Cooper (Jira)

unread,
Jun 16, 2021, 11:39:01 AM6/16/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 21, 2021, 2:23:02 PM6/21/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-8700

Passed CI in e6ba8f9345

Josh Cooper (Jira)

unread,
Jun 21, 2021, 2:26:03 PM6/21/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Bug Fix
Release Notes Summary: The "puppet help" command no longer displays the "--extra" command line option, as it is not functional.

Claire Cadman (Jira)

unread,
Jul 13, 2021, 6:33:04 AM7/13/21
to puppe...@googlegroups.com
Claire Cadman updated an issue
Change By: Claire Cadman
Labels: commandline doc-reviewed

Morgan Rhodes (Jira)

unread,
Oct 13, 2022, 1:47:01 PM10/13/22
to puppe...@googlegroups.com
Morgan Rhodes updated an issue
Change By: Morgan Rhodes
Story Points: 1
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages