Bug 601524

Summary: setAdvancedOptions problem
Product: Red Hat Satellite 5 Reporter: Stanislav Polasek <stanislav.polasek>
Component: APIAssignee: Tomas Lestach <tlestach>
Status: CLOSED ERRATA QA Contact: Jan Hutaƙ <jhutar>
Severity: medium Docs Contact:
Priority: low    
Version: 530CC: cperry, jhutar, pep, pmutha
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: kickstart.profile.setAdvancedCall API call doesn't except "services" and "driverdisk" options accoridig to the documentation Fix: fixed typo (service -> services) and adding driverdisk option to be accepted by the call
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-16 13:58:47 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: 715348    

Description Stanislav Polasek 2010-06-08 06:45:49 UTC
Description of problem:

According to the documentation, the kickstart.profile.setAdvancedCall should accept struct with names and values of advanced options. Documented list of names includes the option name "service". However, when using such name in the struct, the values for that option are not added to the kickstart. 

The related API call, kicsktart.profile.getAdvancedOptions on the other hand returns struct which includes option name "services" (plural). But when I tried to use setAdvancedCall with option name "services", it fails with the error bellow.

Version-Release number of selected component (if applicable):
Latest as of Jun 08

How reproducible:
Always

Steps to Reproduce:
1. create script with setAdvancedOptions call and struct for advanced options including name service
2. run
3. no service parameters are created in the kickstart

Actual results:
Nothing


Expected results:


Additional info:

Using simple script I can print advanced opts struct and then try to make a change:

#!/usr/bin/python

import xmlrpclib

SATELLITE_URL = "https://localhost/rpc/api"
SATELLITE_LOGIN = "admin"
SATELLITE_PASSWORD = "password"

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

print client.kickstart.profile.getAdvancedOptions(key, "xxxxxx")
ao = [{'name': 'services', 'arguments': '--disable portmap'}]
ret = client.kickstart.profile.setAdvancedOptions(key, "xxxxxx", ao)

I get:

[root@rhnt1 ~]# ./test_ks.py 
[{'name': 'skipx'}, {'name': 'rootpw', 'arguments': '$1$IWRajh2F$BYdFL3Ilpr1UkWycY1Cr9/'}, {'name': 'network', 'arguments': '--bootproto dhcp'}, {'name': 'reboot'}, {'name': 'services', 'arguments': '--disable portmap'}, {'name': 'lang', 'arguments': 'en_US'}, {'name': 'auth', 'arguments': '--enablemd5 --enableshadow'}, {'name': 'text'}, {'name': 'bootloader', 'arguments': '--location mbr'}, {'name': 'install'}, {'name': 'zerombr'}, {'name': 'firewall', 'arguments': '--disabled'}, {'name': 'timezone', 'arguments': 'Europe/Prague'}, {'name': 'key', 'arguments': '--skip'}, {'name': 'clearpart', 'arguments': '--all'}, {'name': 'selinux', 'arguments': '--disabled'}, {'name': 'keyboard', 'arguments': 'us'}, {'name': 'url', 'arguments': '--url /ks/dist/ks-rhel-x86_64-server-5-u4'}]
Traceback (most recent call last):
  File "./test_ks.py", line 14, in ?
    ret = client.kickstart.profile.setAdvancedOptions(key, "xxxxxx", ao)
  File "/usr/lib64/python2.3/xmlrpclib.py", line 1029, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.3/xmlrpclib.py", line 1316, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.3/xmlrpclib.py", line 1080, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib64/python2.3/xmlrpclib.py", line 1219, in _parse_response
    return u.close()
  File "/usr/lib64/python2.3/xmlrpclib.py", line 742, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault -5: 'redstone.xmlrpc.XmlRpcFault: Invalid kickstart option present. List of valid options is: [autostep, interactive, install, upgrade, text, network, cdrom, harddrive, nfs, url, lang, langsupport, keyboard, mouse, device, deviceprobe, zerombr, clearpart, bootloader, timezone, auth, rootpw, selinux, reboot, firewall, xconfig, skipx, key, ignoredisk, autopart, cmdline, firstboot, graphical, iscsi, iscsiname, logging, monitor, multipath, poweroff, halt, service, shutdown, user, vnc, zfcp]'>

Comment 1 Paresh Mutha 2011-02-15 09:26:13 UTC
setAdvancedOptions API fails for driverdisk option as well.

Comment 5 Tomas Lestach 2011-02-17 12:18:43 UTC
Hello Paresh,

thank you for your patch, I've applied it as:
spacewalk.git: c996955d0ea39fe06b97ec7e085808c7d04e5a2b

I just needed to update the apidoc accordingly:
spacewalk.git: 99b890b20d843c687cbbabe7fa9acca6f9949134

Comment 7 Tomas Lestach 2011-07-27 13:25:56 UTC
one more apidoc fix ...

spacewalk.git: 4a425624316e235145ab5ddf4a7850218cf77b03

Comment 8 Tomas Lestach 2011-07-27 13:25:56 UTC
    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:
Cause:
kickstart.profile.setAdvancedCall API call doesn't except "services" and "driverdisk" options accoridig to the documentation
Fix:
fixed typo (service -> services) and adding driverdisk option to be accepted by the call

Comment 13 errata-xmlrpc 2011-08-16 13:58:47 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-2011-1162.html