Created attachment 480536 [details] temporary patch which fixes the problem Description of problem: If you call kickstart.profile.addScript()/removeScript() to add/remove script from kickstart profile, the related db entries get updated, but profile's kickstart template file doesn't so that generated kickstart file (through WebUI or during kickstart process) doesn't reflect the changes. Version-Release number of selected component (if applicable): spacewalk-java-1.2.39-29.el5sat (Sat 5.4, but the same problem is in Sat 5.3 too) How reproducible: Always Steps to Reproduce: 1. Create a kickstart profile through WebUI 2. Run the following to add a post script into the kickstart profile (change server, user, pass and kslabel): === <snip> === #!/usr/bin/python from xmlrpclib import Server import xmlrpclib satServer = "server" satUser = "user" satPasswd = "pass" ksLabel = "kslabel" satClient = Server('https://'+satServer+'/rpc/api') satAuth = satClient.auth.login(satUser, satPasswd) print satClient.kickstart.profile.addScript(satAuth, ksLabel, 'echo bla', '', 'post', True) #print satClient.kickstart.profile.removeScript(satAuth, ksLabel, 26) === </snip> === 3. Go to: Systems -> Kickstart -> Profiles -> [profile] -> Kickstart File or fire the following in your browser: http://<sat_hostname>/cblr/svc/op/ks/profile/<ks_label> and you can see that there isn't the post script we just added through the api. Actual results: calling both apis doesn't lead to kickstart change Expected results: it should change the kickstart appropriately Additional info: It seems that someone only forgot to add a routine which would re-generate the profile's kickstart template file as everything other works correctly - kickstart gets properly added into db so that it can be accessed and changed through Systems -> Kickstart -> Profiles -> [profile] -> Scripts. I can see in the source code that every other apis do that. The current behaviour is that somebody creates a ks profile through WebUI, which is then written into template file in /var/lib/rhn/kickstarts/wizard/ with a lot of SNIPPET statements and when somebody wants to print the kickstart file, the related java code connects over http to cobbler, which then replace SNIPPETs and generates the kickstart file into its output, which is then printed by the java code. The attached temporary patch fixes the probem. Workaround: If you call another api, which alters kickstart profile, after calling addScript()/removeScript(), it will lead to profile's kickstart template file re-generation so that changes made by addScript()/removeScript() get reflected. One of such apis is e.g. kickstart.profile.system.enableRemoteCommands()
Martin, thanks for the patch! spacewalk.git: f4958c357d1f98782422812e21c887d7c17ba20d
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Consequence: When changing kickstart scripts via API, kickstart file doesn't get regenerated with respect to the new script content. Result: Kickstart file will be regenerated, whn changing kickstart scripts using API.
Moving to Verified: Testing procedure: - automated test Verified against: spacewalk-java-1.2.39-101
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. http://rhn.redhat.com/errata/RHBA-2011-1388.html