Bug 1507384

Summary: deletion of CV fails when a content host is assigned
Product: Red Hat Satellite Reporter: Sanket Jagtap <sjagtap>
Component: Content ViewsAssignee: John Mitsch <jomitsch>
Status: CLOSED ERRATA QA Contact: Jitendra Yejare <jyejare>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, cwelton, ehelms, jyejare
Target Milestone: UnspecifiedKeywords: Regression, Triaged
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: Environment:
Last Closed: 2018-02-21 17:01:38 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:

Comment 7 John Mitsch 2017-10-30 22:02:54 UTC
Created redmine issue http://projects.theforeman.org/issues/21512 from this bug

Comment 8 Satellite Program 2017-10-31 18:05:21 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21512 has been resolved.

Comment 9 Jitendra Yejare 2017-11-03 10:15:17 UTC
Verified !

@ Satellite 6.3 snap 23

Steps:

Ran automated test case mentioned in comment 6 which follows the same test steps that required to verify this bug.

Automation Logs in short:

1. Host Creation
2017-11-03 15:24:27 - robottelo.ssh - INFO - >>> LANG=en_US.UTF-8  hammer --output=csv host create --medium-id="9" --ip="202.193.32.215" --location-id="2" --operatingsystem-id="5" --lifecycle-environment-id="23" --domain-id="1" --partition-table-id="87" --mac="b6:be:0a:ee:50:35" --content-view-id="26" --organization-id="34" --architecture-id="1" --name="z5IJftdkRB" --root-password="PrJmCoag"
2017-11-03 15:24:31 - robottelo.ssh - INFO - <<< stdout
Message,Id,Name
Host created,24,z5ijftdkrb.rhq.lab.eng.bos.redhat.com


2. Check content host count in 1st CV before Deleting it
hammer content-view info --id="26"
2017-11-03 15:24:44 - robottelo.ssh - INFO - <<< stdout
ID:                     26
Name:                   udRAtJPAzA
Label:                  udRAtJPAzA
Composite:              false
Description:            
Content Host Count:     1
Organization:           qAb0WI3MvD

3. Check content host count in 2nd CV which will have 0 content host before deleting 1st CV:


2017-11-03 15:24:49 - robottelo.ssh - INFO - >>> LANG=en_US.UTF-8  hammer   content-view info --id="27"
2017-11-03 15:24:52 - robottelo.ssh - INFO - <<< stdout
ID:                     27
Name:                   tgHkUxcZoN
Label:                  tgHkUxcZoN
Composite:              false
Description:            
Content Host Count:     0
Organization:           qAb0WI3MvD

4. Delete 1st CV and move content host to 2nd CV:
2017-11-03 15:24:56 - robottelo.ssh - INFO - >>> LANG=en_US.UTF-8  hammer content-view remove --system-content-view-id="27" --system-environment-id="24" --environment-ids="23" --id="26"
2017-11-03 15:25:03 - robottelo.ssh - INFO - <<< stderr
Task af0033e1-3207-4218-8790-6a9b49904656 running: 0.0/1, 0%, elapsed: 00:00:00
Task af0033e1-3207-4218-8790-6a9b49904656 success: 1.0/1, 100%, 0.5/s, elapsed: 00:00:02
Task af0033e1-3207-4218-8790-6a9b49904656 success: 1.0/1, 100%, 0.5/s, elapsed: 00:00:02

5. After Deleting 1st CV, the CV doesn't have any content host:
2017-11-03 15:25:07 - robottelo.ssh - INFO - >>> LANG=en_US.UTF-8  hammer  content-view info --id="26"
2017-11-03 15:25:10 - robottelo.ssh - INFO - <<< stdout
ID:                     26
Name:                   udRAtJPAzA
Label:                  udRAtJPAzA
Composite:              false
Description:            
Content Host Count:     0
Organization:           qAb0WI3MvD

6. Now the 2nd CV has a Content host assigned to it:
2017-11-03 15:25:15 - robottelo.ssh - INFO - >>> LANG=en_US.UTF-8  hammer  content-view info --id="27"
2017-11-03 15:25:18 - robottelo.ssh - INFO - <<< stdout
ID:                     27
Name:                   tgHkUxcZoN
Label:                  tgHkUxcZoN
Composite:              false
Description:            
Content Host Count:     1
Organization:           qAb0WI3MvD


Hence the output is as expected and so moving bug to verified state.

Comment 10 Bryan Kearney 2018-02-21 17:01:38 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