Bug 1624028

Summary: clean_backend_objects does not verify managed host status prior to action
Product: Red Hat Satellite Reporter: Mike McCune <mmccune>
Component: Hosts - ContentAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.2.15CC: aagrawal, cdonnell, ikanner, inecas, mmello, pcreech
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.4.5.81-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1622666 Environment:
Last Closed: 2018-10-11 15:18:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 3 Satellite Program 2018-09-05 18:05:43 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24812 has been resolved.

Comment 5 jcallaha 2018-09-19 20:09:34 UTC
Verified in Satellite 6.3.4 Snap 1

Registered 2 hosts to the satellite. 
Changed one of them to managed (postgres)
Added a compute resource to the other (postgres)
Marked each of their subscription facet uuid's as nil (postgres)
Then ran the rake task.

Since I did these one at a time, the task was targeting one each time.

-bash-4.2# foreman-rake katello:clean_backend_objects COMMIT=true
Host 13 another nil is partially missing subscription information.  Un-registering
Leaving provisioning record for another in place, it is either managed or assigned to a compute resource.1 orphaned consumer id(s) found in candlepin.
0 orphaned consumer id(s) found in pulp.


-bash-4.2# foreman-rake katello:clean_backend_objects COMMIT=true
Host 14 another nil is partially missing subscription information.  Un-registering
Leaving provisioning record for another in place, it is either managed or assigned to a compute resource.1 orphaned consumer id(s) found in candlepin.
0 orphaned consumer id(s) found in pulp.

Comment 7 errata-xmlrpc 2018-10-11 15:18:07 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/RHBA-2018:2915