Bug 1455880 - failSystemAction does not check system action id
Summary: failSystemAction does not check system action id
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 580
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jiří Dostál
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks: sat58-errata
TreeView+ depends on / blocked
 
Reported: 2017-05-26 11:16 UTC by Ales Dujicek
Modified: 2017-12-13 07:58 UTC (History)
4 users (show)

Fixed In Version: spacewalk-java-2.5.14-102-sat
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-13 07:58:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:3445 0 normal SHIPPED_LIVE Red Hat Satellite 5.8.0 bug fix update 2017-12-12 19:00:37 UTC

Description Ales Dujicek 2017-05-26 11:16:13 UTC
Description of problem:

API call schedule.failSystemAction does not check if the action ID is valid
if it is not, it fail: unhandled internal exception: null

I would expect error message like: cannot find system %s action %d...

schedule.failSystemAction(key, SID, AID, "error message")
Traceback (most recent call last):
  File "bz1452080.py", line 15, in <module>
    print client.schedule.failSystemAction(key, SID, AID, "error message")
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault -1: 'redstone.xmlrpc.XmlRpcFault: unhandled internal exception: null'>


import sys
import xmlrpclib

client = xmlrpclib.Server('http://localhost/rpc/api')
key = client.auth.login('ales', 'nimda')

SID=int(sys.argv[1])
AID=int(sys.argv[2])

print client.schedule.failSystemAction(key, SID, AID, "error message")


Version-Release number of selected component (if applicable):
spacewalk-java-2.5.14-83.el6sat.noarch

How reproducible:
always

Comment 1 Jiří Dostál 2017-07-20 13:51:33 UTC
spacewalk 70abf819db8c46be2b6d4579dae60269ef246e04

Comment 3 Lukáš Hellebrandt 2017-11-13 15:12:00 UTC
Verified with spacewalk-java-2.5.14-104.

Calls client.schedule.failSystemAction(<key>,<SID>,<AID>) and client.schedule.failSystemAction(<key>,<SID>,<AID>,<message>) work and when attempting to remove an action that does not exist, they stop with:

Traceback (most recent call last):
  File "./test.py", line 7, in <module>
    client.schedule.failSystemAction(key,1000010000,6)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault -1: 'redstone.xmlrpc.XmlRpcFault: unhandled internal exception: Could not find action 6 on system 1000010000'>

... which is correct.

Comment 6 errata-xmlrpc 2017-12-13 07:58:38 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-2017:3445


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