Bug 493421 - deleteTreeAndProfiles refuses to delete distribution if some profiles are using it
deleteTreeAndProfiles refuses to delete distribution if some profiles are usi...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
530
All Linux
low Severity medium
: ---
: ---
Assigned To: Brad Buckingham
Sayli Karmarkar
:
Depends On:
Blocks: 456996
  Show dependency treegraph
 
Reported: 2009-04-01 13:26 EDT by Sayli Karmarkar
Modified: 2015-03-22 21:09 EDT (History)
2 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-10 15:55:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sayli Karmarkar 2009-04-01 13:26:28 EDT
Description of problem:
deleteTreeAndProfiles is supposed to delete kickstart tree along with all the profiles associated with it, but it seems to be refusing to do that. 

Steps to Reproduce:
1. Create a kickstart distribution 
2. server.kickstart.tree.create(key, "foobar", "/var/satellite/rhn/kickstart/ks-rhel-i386-server-5", "rhel-i386-server-5", "rhel_5")
3. Create a profile "temp-profile" using this tree. 
4. server.kickstart.tree.delete(key, "foobar")
  
Actual results:
<Fault 2757: 'redstone.xmlrpc.XmlRpcFault: The Kickstart Distribution you have chosen to delete is in use.  Please delete or change the Distribution for Kickstart Profiles using this Distribution.'>

Expected results:
It should delete tree along with related profiles as per docs.
Comment 1 Brad Buckingham 2009-04-02 10:07:38 EDT
git commit: d5661f414a0229e685631906b596cfe24458fab3

Updated API to remove any profiles associated with the tree being deleted.
Comment 2 Brad Buckingham 2009-04-02 10:15:20 EDT
the commit in #1 is from the VADER branch...
the commit in to master is: ac1887d26123c8b430d26c82d4ff5dadcb6abd90
Comment 3 Sayli Karmarkar 2009-04-15 14:50:34 EDT
Verified manually and with automation test.
Comment 4 John Sefler 2009-08-31 11:08:37 EDT
Verified on staged (Satellite-5.3.0-RHEL5-re20090724.0) with updates from Aug 20, 2009

[jsefler@jsefler rpcapi]$ ant -Dnamespace=tree
...
invoke-tests-subsystem:
     [echo] 
     [echo] --------------------------------------------------------------------
     [echo] Running all tests in tree subsystem ...
     [echo] --------------------------------------------------------------------
     [echo]       
    [mkdir] Created dir: /home/jsefler/workspace/rpcapi/reports
    [junit] Running com.redhat.rhn.rpc.api.kickstart.tree.create
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 3.417 sec
    [junit] Running com.redhat.rhn.rpc.api.kickstart.tree.delete
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.337 sec
    [junit] Running com.redhat.rhn.rpc.api.kickstart.tree.deleteTreeAndProfiles
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 4.821 sec
    [junit] Running com.redhat.rhn.rpc.api.kickstart.tree.list
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.352 sec
    [junit] Running com.redhat.rhn.rpc.api.kickstart.tree.listInstallTypes
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.286 sec
    [junit] Running com.redhat.rhn.rpc.api.kickstart.tree.rename
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 2.498 sec
    [junit] Running com.redhat.rhn.rpc.api.kickstart.tree.update
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 2.289 sec


Also tested manually...
Manually attempting to delete a kickstart distro that is currently in use by a kickstart profile is blocked in the satellite GUI as follows:

Confirm Distribution Deletion

NOTE: The Kickstart Distribution you have chosen to delete is in use by the following Kickstart Profiles. You must change the Distribution used in the profiles below before deleting this Distribution. Click the label in the link to edit the profile's Distribution. 

moving to RELEASE_PENDING
Comment 5 Brandon Perkins 2009-09-10 15:55:19 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html

Note You need to log in before you can comment on or make changes to this bug.