Bug 1571800

Summary: hammer content-view puppet-module add fails with wrong number of arguments (given 1, expected 0)
Product: Red Hat Satellite Reporter: Lukas Pramuk <lpramuk>
Component: Content ViewsAssignee: Evgeni Golov <egolov>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: NightlyCC: cfouant, egolov, rplevka, tstrachota
Target Milestone: 6.4.0Keywords: Regression, Reopened, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-hammer_cli_katello-0.13.0-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:28:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lukas Pramuk 2018-04-25 12:44:33 UTC
Description of problem:
hammer content-view puppet-module add fails with wrong number of arguments (given 1, expected 0)

Version-Release number of selected component (if applicable):
6.4.0 pre
katello-3.7.0-2.nightly.el7sat.noarch
foreman-1.18.0.0.1-0.1.el7sat.noarch
tfm-rubygem-hammer_cli-0.12.0-1.el7sat                               
tfm-rubygem-hammer_cli_foreman-0.12.1-1.el7sat                       
tfm-rubygem-hammer_cli_katello-0.12.0-1.el7sat                       


How reproducible:
100%

Steps to Reproduce:
1. # hammer -v content-view puppet-module add --author="robottelo" --name="generic_1" --content-view-id="120"
...

[ERROR 2018-04-23T15:35:40 Exception] wrong number of arguments (given 1, expected 0)
Could not add the puppet module:
  wrong number of arguments (given 1, expected 0)
[ERROR 2018-04-23T15:35:40 Exception] 

ArgumentError (wrong number of arguments (given 1, expected 0)):
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.12.0/lib/hammer_cli_katello/content_view_puppet_module.rb:40:in `get_identifier'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.12.1/lib/hammer_cli_foreman/option_sources/self_param.rb:11:in `get_options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/lib/hammer_cli/options/option_collector.rb:13:in `block in all_options_raw'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/lib/hammer_cli/options/option_collector.rb:12:in `each'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/lib/hammer_cli/options/option_collector.rb:12:in `inject'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/lib/hammer_cli/options/option_collector.rb:12:in `all_options_raw'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/lib/hammer_cli/options/option_collector.rb:18:in `all_options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/lib/hammer_cli/options/option_collector.rb:22:in `options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/lib/hammer_cli/abstract.rb:239:in `options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/lib/hammer_cli/abstract.rb:42:in `parse'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:62:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.12.0/bin/hammer:142:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'

Actual results:
Exception - wrong number of arguments (given 1, expected 0)

Expected results:
Successful puppet module addition

Comment 3 Brad Buckingham 2018-05-01 21:36:45 UTC
*** Bug 1573236 has been marked as a duplicate of this bug. ***

Comment 5 Christine Fouant 2018-05-09 14:16:35 UTC
Tested upstream, couldn't reproduce:

[vagrant@centos7-hammer-devel ~]$ hammer -v content-view puppet-module add --author "puppetlabs" --name "concat" --content-view-id 3
Puppet module added to content view

Comment 7 Lukas Pramuk 2018-05-10 13:47:24 UTC
@Sat6.4.0 Snap 2 - BUG present
tfm-rubygem-hammer_cli-0.12.0-1.el7sat.noarch
foreman-1.18.0.0.1-0.1.el7sat.noarch
katello-3.7.0-3.nightly.el7sat.noarch

# hammer content-view create --name "Puppet View" --organization-id 1 --product Internal

# hammer content-view puppet-module add --author lpramuk --name mc --content-view "Puppet View" --organization-id 1
Could not add the puppet module:
  wrong number of arguments (given 1, expected 0)


vs.


@Upstream - it works OK
tfm-rubygem-hammer_cli-0.13.pre.develop-1.201803232224gite493035.el7.noarch
foreman-1.18.0-0.develop.201805080055git36d17b1.el7.noarch
katello-3.7.0-3.nightly.el7.noarch

# hammer content-view puppet-module add --author lpramuk --name mc --content-view "Puppet View" --organization-id 1
Puppet module added to content view

Isn't the fix to bring hammer 0.13 downstream?

Comment 8 Lukas Pramuk 2018-05-10 14:01:50 UTC
Nope.

Comment 9 Evgeni Golov 2018-05-14 15:11:45 UTC
I still think it's a packaging issue, looking into it

Comment 10 Evgeni Golov 2018-05-14 15:39:42 UTC
it requires a change to hammer_cli_katello, which is not in a released version of that gem yet.

Comment 11 Evgeni Golov 2018-05-15 07:51:35 UTC
0.13.0 was released and built, moving to on_dev

Comment 12 Lukas Pramuk 2018-05-25 08:32:02 UTC
VERIFIED.

@satellite-6.4.0-7.beta.el7sat.noarch
foreman-1.18.0.0.7-1.el7sat.noarch
katello-3.7.0-3.nightly.el7sat.noarch

tfm-rubygem-hammer_cli-0.13.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-0.13.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_katello-0.13.1-1.el7sat.noarch


# hammer content-view create --name "Puppet View" --organization-id 1 --product Internal
Content view created

# hammer content-view puppet-module add --author lpramuk --name mc --content-view "Puppet View" --organization-id 1
Puppet module added to content view

Comment 13 Bryan Kearney 2018-10-16 19:28:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:2927