Bug 1427261

Summary: Hammer- can't remove puppet module from content view by id -- uuid is sent instead
Product: Red Hat Satellite Reporter: Stanislav Tkachenko <stkachen>
Component: Content ViewsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, katello-qa-list, satellite6-bugs, stkachen, tstrachota
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1427260 Environment:
Last Closed: 2017-03-01 11:41:14 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:
Bug Depends On: 1427260    
Bug Blocks:    

Description Stanislav Tkachenko 2017-02-27 17:37:30 UTC
+++ This bug was initially created as a clone of Bug #1427260 +++

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 2 Brad Buckingham 2017-02-28 17:59:17 UTC
Is this a duplicate of bug 1427260?

Comment 3 Stanislav Tkachenko 2017-03-01 07:00:51 UTC
(In reply to Brad Buckingham from comment #2)
> Is this a duplicate of bug 1427260?

I'm not sure how we handle new bugs that are valid for both 6.2 and 6.3 nowadays, so I've cloned 1427260 to track 6.3 status. If it is not correct please close this BZ.

Comment 4 Brad Buckingham 2017-03-01 11:41:14 UTC
Hi Stanislav,

For now, a single bugzilla should be created and proposed for the desired releases (e.g. 6.2.z & 6.3.0).  Once the fix is in the upstream and the bug is committed to a specific 6.2.z, a clone will be created to cover the 2 instances of the bugzilla.  This approach is being taken to minimize some of the overall BZ maintenance and relieve some confusion when folks are looking within bugzilla.

Based on the above, I'll close this one and we can clone it when the time is right.

Thanks!

*** This bug has been marked as a duplicate of bug 1427260 ***