Bug 493176

Summary: Addition of api kickstart.tree.getDetails to get details about custom kickstart distribution
Product: Red Hat Satellite 5 Reporter: Sayli Karmarkar <skarmark>
Component: APIAssignee: Tomas Lestach <tlestach>
Status: CLOSED ERRATA QA Contact: Petr Sklenar <psklenar>
Severity: medium Docs Contact:
Priority: low    
Version: 530CC: cperry, psklenar
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-03 14:18:12 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: 518263    

Description Sayli Karmarkar 2009-03-31 20:53:29 UTC
Description of problem:
We need a way in which we can get details about a specific custom created kickstart distribution such that we pass String kickstartTreeLabel and it returns treepath, channel and install_type. 

Currently we have kickstart.tree.list(channelLabel) which returns all kickstart distributions for specific channel. 

Creating a bug so that we don't forget to add it in the list of API for next version.

Comment 1 Tomas Lestach 2010-01-19 16:10:57 UTC
Introducing API call:
kickstart.tree.getDetails(sessionKey,treeLabel) that returns KickstartableTree or InvalidChannelLabelException

spacewalk.git: 29fdd175dee934867a7e824437f724d57f92e646

Comment 3 Tomas Lestach 2010-02-17 13:47:48 UTC
satellite.git: de7434845d1c1e9be9376fdcd05871ab83b9be75

Comment 4 Petr Sklenar 2010-02-23 15:15:41 UTC
test:
for channel in client.channel.listAllChannels(key):
	for tree in client.kickstart.tree.list(key,channel["label"]):
		 getDetails=client.kickstart.tree.getDetails(key,tree["label"])
		 print "------------------------------"
		 print "tree[label] %s" % tree["label"]
		 print "getDetails[id] %s" % getDetails["id"]
		 print "getDetails[label] %s" % getDetails["label"]
		 print "getDetails[base_path] %s" % getDetails["base_path"]
		 print "getDetails[channel_id] %s" % getDetails["channel_id"]
OUTPUT:

tree[label] ks-rhel-i386-server-5-u3
getDetails[id] 9
getDetails[label] ks-rhel-i386-server-5-u3
getDetails[base_path] rhn/kickstart/ks-rhel-i386-server-5-u3
getDetails[channel_id] 121
------------------------------
tree[label] ks-rhel-i386-server-5-u4
getDetails[id] 10
getDetails[label] ks-rhel-i386-server-5-u4
getDetails[base_path] rhn/kickstart/ks-rhel-i386-server-5-u4
getDetails[channel_id] 121

tested with: spacewalk-java-0.5.44-66.5.el4sat.noarch
---
moving to Verified

Comment 5 Tomas Lestach 2010-02-24 16:28:52 UTC
Because relative path is returned for rhel ks trees and absolute path for custom ks trees (as "base_path"), I agreed witk psklenar to unify the path for this API call.
I introduced "abs_path" for both ks tree types.
Additionally I included "install_type" to the tree details as requested in the BZ description.

spacewalk.git: 951c44cfff631ef80a43a3a3c6d534578187ac84
satellite.git: ce9b337bd478cb17af4d80b110fc8ac6efbcd3ee

Comment 6 Petr Sklenar 2010-02-25 12:57:54 UTC
 With updated version of spacewalk-java-0.5.44-66.7.el5sat.noarch it returns
more details and more consistent results. Mainly absolute path for custom ks
and default ks(ks-rhel-i386-server-5-u4 etc) is same.

for channel in client.channel.listAllChannels(key):
        for tree in client.kickstart.tree.list(key,channel["label"]):
                 getDetails=client.kickstart.tree.getDetails(key,tree["label"])
                 print "------------------------------"
                 print "tree[label] %s" % tree["label"]
   print "getDetails - all %s" % getDetails
                 print "getDetails[id] %s" % getDetails["id"]
                 print "getDetails[label] %s" % getDetails["label"]
                 print "getDetails[abs_path] %s" % getDetails["abs_path"]
                 print "getDetails[channel_id] %s" % getDetails["channel_id"]
   print "install_type.id: %s" % getDetails["install_type"]["id"]
   print "install_type.label: %s" % getDetails["install_type"]["label"]
     print "install_type.name: %s" % getDetails["install_type"]["name"]

OUTPUT:

tree[label] ks-rhel-i386-server-5-u4
getDetails - all {'install_type': {'id': 1, 'name': 'Red Hat Enterprise Linux
5', 'label': 'rhel_5'}, 'channel_id': 121, 'abs_path':
'/var/satellite/rhn/kickstart/ks-rhel-i386-server-5-u4', 'id': 10, 'label':
'ks-rhel-i386-server-5-u4'}
getDetails[id] 10
getDetails[label] ks-rhel-i386-server-5-u4
getDetails[abs_path] /var/satellite/rhn/kickstart/ks-rhel-i386-server-5-u4
getDetails[channel_id] 121
install_type.id: 1
install_type.label: rhel_5
install_type.name: Red Hat Enterprise Linux 5
------------------------------
tree[label] kstree5YsmJG5TH4UM2
getDetails - all {'install_type': {'id': 1, 'name': 'Red Hat Enterprise Linux
5', 'label': 'rhel_5'}, 'channel_id': 121, 'abs_path':
'/var/satellite/rhn/kickstart/ks-rhel-i386-server-5', 'id': 47, 'label':
'kstree5YsmJG5TH4UM2'}
getDetails[id] 47
getDetails[label] kstree5YsmJG5TH4UM2
getDetails[abs_path] /var/satellite/rhn/kickstart/ks-rhel-i386-server-5
getDetails[channel_id] 121
install_type.id: 1
install_type.label: rhel_5
install_type.name: Red Hat Enterprise Linux 5

--
Verified

Comment 8 errata-xmlrpc 2010-03-03 14:18:12 UTC
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/RHBA-2010-0128.html