Bug 601524 - setAdvancedOptions problem
setAdvancedOptions problem
Status: CLOSED ERRATA
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
530
All Linux
low Severity medium
: ---
: ---
Assigned To: Tomas Lestach
Jan Hutař
:
Depends On:
Blocks: sat54-blockers
  Show dependency treegraph
 
Reported: 2010-06-08 02:45 EDT by Stanislav Polasek
Modified: 2011-08-16 09:58 EDT (History)
4 users (show)

See Also:
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 09:58:47 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1162 normal SHIPPED_LIVE Red Hat Network Satellite Server spacewalk-java bug fix update 2011-08-16 09:56:28 EDT

  None (edit)
Description Stanislav Polasek 2010-06-08 02:45:49 EDT
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 04:26:13 EST
setAdvancedOptions API fails for driverdisk option as well.
Comment 5 Tomas Lestach 2011-02-17 07:18:43 EST
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 09:25:56 EDT
one more apidoc fix ...

spacewalk.git: 4a425624316e235145ab5ddf4a7850218cf77b03
Comment 8 Tomas Lestach 2011-07-27 09:25:56 EDT
    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 09:58:47 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/RHBA-2011-1162.html

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