Bug 880346

Summary: Deletion of org does not result in deletion of associated Kickstart profiles from Cobbler
Product: [Community] Spacewalk Reporter: Stephen Herr <sherr>
Component: WebUIAssignee: Stephen Herr <sherr>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: high    
Version: 1.9CC: ckannan, cperry, ddevaraj, ssalevan, tlestach, tpapaioa
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: spacewalk-java-1.9.22-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 517146 Environment:
Last Closed: 2013-03-06 18:35:22 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:
Bug Depends On:    
Bug Blocks: 819027, 917805    

Description Stephen Herr 2012-11-26 18:45:49 UTC
+++ This bug was initially created as a clone of Bug #517146 +++

Description of problem:
If a user deletes an org from their Satellite, the Kickstart profiles that they have created will not be deleted from Cobbler, and can be viewed from another org.

Version-Release number of selected component (if applicable):
530, Stage build

How reproducible:
Always

Steps to Reproduce:
1. Create an org and grant it provisioning entitlements
2. Create several kickstart profiles under this org
3. Delete this org
4. Create another org and grant it provisioning entitlements
5. Login as the orgadmin for this new org
  
Actual results:
Old org's profiles can be viewed from the SDC of any Provisioning-entitled system

Expected results:
Old org's profiles cannot be viewed from the SDC of any Provisioning-entitled system

Additional info:

--- Additional comment from Clifford Perry on 2009-08-12 15:58:51 EDT ---

punted for now - bad bug and we *need* to fix post 530 GA.

--- Additional comment from Tony Fu on 2010-06-30 00:30:16 EDT ---

User ssalevan's account has been closed

--- Additional comment from Tony Fu on 2010-06-30 00:32:28 EDT ---

User ssalevan's account has been closed

--- Additional comment from Tony Fu on 2010-06-30 00:41:42 EDT ---

User ssalevan's account has been closed

--- Additional comment from Tasos Papaioannou on 2010-10-21 09:49:53 EDT ---

Appears to be due to the fact that an orphaned cfg file is left behind after deletion of the first org's kickstart profile:

# ll /var/lib/rhn/kickstarts/wizard
[...]
-rw-r--r-- 1 tomcat tomcat  8081 Oct 21 09:01 bz-517146-ks--43.cfg

^ cfg file for ks profile from deleted org #43.

In the new org, this cfg file shows up as a non-Satellite-managed kickstart profile. The associated ks profile data in the database has been deleted; it's just the cfg file that needs to be deleted.

--- Additional comment from Stephen Herr on 2012-11-21 14:29:54 EST ---

*** Bug 837796 has been marked as a duplicate of this bug. ***

--- Additional comment from Stephen Herr on 2012-11-26 13:45:17 EST ---

No, this is actually due to the fact that the Cobbler profiles are not removed when the Org is deleted.

$ cobbler profile list

Comment 1 Stephen Herr 2012-11-26 20:56:17 UTC
Committed to Spacewalk master: 4532f5ab0389132ce041938ecbe02273cd6e8c56

Comment 2 Tomas Lestach 2012-11-27 08:23:54 UTC
I mean we need a similar routine for the API.

Comment 3 Stephen Herr 2012-11-27 20:08:39 UTC
(In reply to comment #2)
> I mean we need a similar routine for the API.

You are right, I should put this functionality at the OrgFactory level so it is called no matter where the request originates from.

I have reverted 4532f5ab0389132ce041938ecbe02273cd6e8c56 and committed a new fix to Spacewalk master:
04e048722f3c03209d77506be33e432e99970883

Comment 4 Stephen Herr 2013-03-01 17:07:49 UTC
Marking bug as ON_QA since tonight's build of Spacewalk nightly is a release candidate for Spacewalk 1.9.

Comment 5 Stephen Herr 2013-03-06 18:35:22 UTC
Spacewalk 1.9 has been released.

https://fedorahosted.org/spacewalk/wiki/ReleaseNotes19