Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1507491

Summary: API kickstart.profile.set_kickstart_tree does not seem to update distribution in the KS link, webUI does
Product: Red Hat Satellite 5 Reporter: Jan Hutař <jhutar>
Component: APIAssignee: Jan Dobes <jdobes>
Status: CLOSED ERRATA QA Contact: Martin Korbel <mkorbel>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 580CC: jdostal, mkorbel, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-java-2.5.14-108-sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-05 13:56:41 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:
Bug Depends On:    
Bug Blocks: 1450111    

Description Jan Hutař 2017-10-30 12:08:38 UTC
Description of problem:
API kickstart.profile.set_kickstart_tree does not seem to update distribution in the KS link, webUI does


Version-Release number of selected component (if applicable):
spacewalk-java-2.5.14-101.el6sat.noarch
satellite-schema-5.8.0.34-1.el6sat.noarch


How reproducible:
always


Steps to Reproduce:
1. Have Kickstart profile "ks-dist-bz1349403-24530" with distro tree set to "dist-bz1349403-29881"
   # spacewalk-api --server=<fqdn> --user=<user> --password=<pass> kickstart.profile.getKickstartTree %session% ks-dist-bz1349403-24530
   $result = 'dist-bz1349403-24530';
   # cobbler profile getks --name=ks-dist-bz1349403-24530:1:Satellite5QEteam | grep ^url
   url --url http://<fqdn>/ks/dist/org/1/dist-bz1349403-24530
2. Use simple API script to modify the distribution tree:
   # python set_kickstart_tree.py <user> <pass> https://<fqdn>/rpc/api ks-dist-bz1349403-24530 dist-bz1349403-29881
   1
3. Ensure that URL changes properly


Actual results:
URL does not change:

    # spacewalk-api --server=<fqdn> --user=<user> --password=<pass> kickstart.profile.getKickstartTree %session% ks-dist-bz1349403-24530
    $result = 'dist-bz1349403-29881';
    # cobbler profile getks --name=ks-dist-bz1349403-24530:1:Satellite5QEteam | grep ^url
    url --url http://<fqdn>/ks/dist/org/1/dist-bz1349403-24530

When you do this in webUI (Systems -> Kickstart -> Profiles -> <profile> -> Kickstart Details -> Operating System -> Available Trees*: dist-bz1349403-29881 it is reflected into KS nicely:

    # spacewalk-api --server=<fqdn> --user=<user> --password=<pass> kickstart.profile.getKickstartTree %session% ks-dist-bz1349403-24530
    $result = 'dist-bz1349403-29881';
    # cobbler profile getks --name=ks-dist-bz1349403-24530:1:Satellite5QEteam | grep ^url
    url --url http://<fqdn>/ks/dist/org/1/dist-bz1349403-29881


Expected results:
URL should get changed as when you do it in webUI.


Additional info:
API script used is very simple:

    #!/usr/bin/python
    import xmlrpclib
    import sys

    try:
        SATELLITE_LOGIN = sys.argv[1]
        SATELLITE_PASSWORD = sys.argv[2]
        SATELLITE_URL = sys.argv[3]
        KS_LABEL = sys.argv[4]
        KS_TREE = sys.argv[5]
    except IndexError, e:
        sys.exit("wrong parameters")

    client = xmlrpclib.Server(SATELLITE_URL)
    key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)

    print client.kickstart.profile.set_kickstart_tree(key, KS_LABEL, KS_TREE)

    client.auth.logout(key)

Comment 1 Jan Dobes 2017-11-01 15:05:26 UTC
fixed in spacewalk.git(master):

57412eba2d04ff485906ba43a6e157805f373b65

Comment 4 Martin Korbel 2018-01-11 10:35:32 UTC
VERIFIED on spacewalk-java-2.5.14-108

Reproducer via comment 0

Comment 7 errata-xmlrpc 2018-02-05 13:56:41 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:0274