Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1427260 - Hammer- can't remove puppet module from content view by id -- uuid is sent instead
Summary: Hammer- can't remove puppet module from content view by id -- uuid is sent in...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Views
Version: 6.2.8
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Andrew Kofink
QA Contact: Ales Dujicek
URL:
Whiteboard:
: 1427261 (view as bug list)
Depends On:
Blocks: 1427261
TreeView+ depends on / blocked
 
Reported: 2017-02-27 17:35 UTC by Stanislav Tkachenko
Modified: 2019-04-01 20:27 UTC (History)
7 users (show)

Fixed In Version: tfm-rubygem-hammer_cli_katello-0.10.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1427261 (view as bug list)
Environment:
Last Closed: 2018-02-21 16:54:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 18923 0 Normal Closed Hammer- can't remove puppet module from content view by id -- uuid is sent instead 2020-06-08 19:41:34 UTC

Description Stanislav Tkachenko 2017-02-27 17:35:52 UTC
Description of problem:

Can't remove puppet module from content view by id using hammer. According to hammer debug, uuid is sent instead of id:
>[ INFO 2017-02-27 12:29:08 HammerCLIKatello::ContentView] Called with options: {}
> [ INFO 2017-02-27 12:29:08 HammerCLIKatello::ContentViewPuppetModule] Called with options: {}
> [ INFO 2017-02-27 12:29:08 API] Server: https://localhost/
> [ INFO 2017-02-27 12:29:08 API] GET /katello/api/content_views/118/content_view_puppet_modules
> [DEBUG 2017-02-27 12:29:08 API] Params: {
>    "uuid" => "44"
>}
>[DEBUG 2017-02-27 12:29:08 API] Headers: {
>    :params => {
>        "uuid" => "44"
>    }
>}

Also it is not clear what exactly id should be used, the one from global `puppet-module list` command output, like it is done for `content-view puppet-module add`, or from the `content-view info` output. However, both doesn't allow to remove puppet module. --name and --uuid parameters work as expected.

> # hammer -v content-view info --id 121
> Puppet Modules:         
> 1) ID:      46
>    UUID:    2de63c7f-d0fb-4a29-b301-449a52c026d7
>    Name:    generic_1

> # hammer -v content-view puppet-module remove --content-view-id="121" --id="46"
> [ERROR 2017-02-27 12:05:29 Exception] Error: content_view_puppet_module not found
> Couldn't remove puppet module from the content view:
>  Error: content_view_puppet_module not found

> # hammer -v  puppet-module list
> ID,Name,Author,Version,Uuid
> 3,generic_1,robottelo,0.2.0,2de63c7f-d0fb-4a29-b301-449a52c026d7

> hammer -v content-view puppet-module remove --content-view-id="121" --id="3"
> [ERROR 2017-02-27 12:07:48 Exception] Error: content_view_puppet_module not found
> Couldn't remove puppet module from the content view:
>  Error: content_view_puppet_module not found

Version-Release number of selected component (if applicable):
Satellite 6.2.8 Snap 3.0:
* satellite-6.2.8-1.0.el7sat.noarch
* foreman-1.11.0.66-2.el7sat.noarch
* katello-3.0.0-17.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create Content View
2. Create puppet repo with modules
3. Associate puppet module with CV using `hammer content-view puppet-module add`
4. Try to remove using `hammer content-view puppet-module remove --id`

Actual results:
Exception is raised.

Expected results:
Puppet module should removed.

Additional info:

Comment 3 Brad Buckingham 2017-03-01 11:41:14 UTC
*** Bug 1427261 has been marked as a duplicate of this bug. ***

Comment 4 Andrew Kofink 2017-03-15 19:32:48 UTC
Created redmine issue http://projects.theforeman.org/issues/18923 from this bug

Comment 5 Satellite Program 2017-04-07 14:14:56 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18923 has been resolved.

Comment 6 Justin Sherrill 2017-08-02 15:53:26 UTC
Failed QA  6.3.0 snap 9.0


Getting an error when using --id

[root@jsherrill-test ~]# hammer -vv -p changeme content-view puppet-module remove --content-view-id=2 --id=1
[ERROR 2017-08-02 15:51:12 Exception] Error: content_view_puppet_module not found
Couldn't remove puppet module from the content view:
  Error: content_view_puppet_module not found
[ERROR 2017-08-02 15:51:12 Exception] 

HammerCLIForeman::ResolverError (content_view_puppet_module not found):
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.10.2/lib/hammer_cli_foreman/id_resolver.rb:208:in `pick_result'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.10.2/lib/hammer_cli_foreman/id_resolver.rb:168:in `find_resource'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.10.2/lib/hammer_cli_foreman/id_resolver.rb:143:in `get_id'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.10.2/lib/hammer_cli_foreman/id_resolver.rb:133:in `block (2 levels) in define_id_finders'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.10.0/lib/hammer_cli_katello/content_view_puppet_module.rb:59:in `resolve_puppet_module_id_from_uuid'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.10.0/lib/hammer_cli_katello/content_view_puppet_module.rb:65:in `all_options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.10.2/lib/hammer_cli_foreman/commands.rb:125:in `get_resource_id'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.10.2/lib/hammer_cli_foreman/commands.rb:199:in `block in customized_options'


Still works fine with uuid:

[root@jsherrill-test ~]# hammer -p changeme content-view puppet-module remove --content-view-id=2 --uuid=4ca76f05-f98e-407b-b7e6-a779dc5b1660
Puppet module removed from content view

maybe the commit didn't make it in somehow?

tfm-rubygem-hammer_cli_katello-0.10.0-1.el7sat.noarch

Comment 7 Andrew Kofink 2017-09-06 12:39:42 UTC
This change starts in tfm-rubygem-hammer_cli_katello-0.10.1

Comment 8 Brad Buckingham 2017-09-06 12:46:39 UTC
Thanks Andrew!

Adding 'fixed in version' based on comment 7.

Comment 10 Satellite Program 2018-02-21 16:54:37 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:0336


Note You need to log in before you can comment on or make changes to this bug.