Bug 1872161

Summary: When deleting a content view version, all hosts have been listed as affected even hosts are not using it
Product: Red Hat Satellite Reporter: Hao Chang Yu <hyu>
Component: Content ViewsAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Lai <ltran>
Severity: medium Docs Contact:
Priority: high    
Version: 6.7.0CC: jsherril, pcreech
Target Milestone: 6.9.0Keywords: Triaged, UserExperience
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.18.1-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-21 13:17:42 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 Hao Chang Yu 2020-08-25 08:15:34 UTC
Description of problem:
When deleting a content view version, all hosts have been listed as affected even hosts are not assigned to it.

Version-Release number of selected component (if applicable):
6.7

How reproducible:
When there is at least one affected host

Steps to Reproduce:
1. Create a content view and publish it to an environment
2. Assign a couple of hosts to the content view
3. Delete the content view version through the web ui

Content -> Content Views -> the CV -> Versions tab -> Remove the latest version.

4. Check "Completely remove version?" checkbox to delete the version completely and click "Next" button.

5. In the "Content Hosts using Version" page click the "Show affected Content Hosts" link to show all affected hosts

Actual results:
All hosts are listed

Expected results:
Only affected hosts are listed

Comment 2 Justin Sherrill 2020-10-02 00:48:37 UTC
Yes, i'd expect the request to include content_view_version_id...

Comment 3 Justin Sherrill 2020-12-03 19:17:15 UTC
Created redmine issue https://projects.theforeman.org/issues/31445 from this bug

Comment 4 Bryan Kearney 2020-12-03 20:03:02 UTC
Upstream bug assigned to jsherril

Comment 5 Bryan Kearney 2020-12-03 20:03:04 UTC
Upstream bug assigned to jsherril

Comment 6 Bryan Kearney 2020-12-14 16:03:04 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/31445 has been resolved.

Comment 7 Lai 2021-01-20 19:42:42 UTC
Steps to retest:

1. Create a LCE right after Library
2. Create a cv and publish it
3. Promote cv to LCE created in step 1.
4. Create a few hosts (I did 6)
5. Assign some hosts to CV to different environments (I did 3 hosts)
6. Delete cv version via web ui: Content -> Content Views -> the CV -> Versions tab -> Remove the latest version
7. Check "Completely remove version?" checkbox and click "Next" button
8. Click "Show affected content hosts" link to show all affected hosts in the "Content Hosts using Version" page
9. Repeat 4-8 but for 2 activation keys

Expected Result:
Table should only display 3 affected hosts.

Actual Result:
Table only displayed 3 affected hosts.

Verified on 6.9.0_09 and tfm-rubygem-katello-3.18.1.2-1.el7sat.noarch

Comment 10 errata-xmlrpc 2021-04-21 13:17:42 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 (Moderate: Satellite 6.9 Release), 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-2021:1313