Bug 1445254 - Can't remove a package from a system when it's not synced in the satellite using API. schedulePackageRemoveByNevra can not find it.
Summary: Can't remove a package from a system when it's not synced in the satellite us...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomáš Kašpárek
QA Contact: Ales Dujicek
URL:
Whiteboard:
Depends On:
Blocks: sat58-errata sat58-nth
TreeView+ depends on / blocked
 
Reported: 2017-04-25 11:16 UTC by Lukáš Hellebrandt
Modified: 2018-02-05 13:57 UTC (History)
4 users (show)

Fixed In Version: spacewalk-java-2.5.14-108-sat
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-05 13:57:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0274 0 normal SHIPPED_LIVE Red Hat Satellite 5.8.0 bug fix update 2018-02-09 23:18:15 UTC

Description Lukáš Hellebrandt 2017-04-25 11:16:38 UTC
Description of problem:
In WebUI, if a registered system has a package that is not on the Satellite, it can still be scheduled for removal. In API, however, I have not found a way to do this.

schedulePackageRemove requires package ID.
schedulePackageRemoveByNevra does not require package ID but still does not find the package (as it probably searches the database which does not contain it) and fails with (for antlr package):

Traceback (most recent call last):
  File "./z.py", line 9, in <module>
    res = client.system.schedulePackageRemoveByNevra(key,1000010001,[{'package_name': "antlr", 'package_epoch': "0", 'package_version': "2.7.7", 'package_release': "6.5.el6", 'package_arch': "x86_64"}], datetime.now())
  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 2300: 'redstone.xmlrpc.XmlRpcFault: Invalid package: antlr'>


How reproducible:
Deterministic

Steps to Reproduce:
For an existing system with antlr-2.7.7-6.5.el6:0 package installed and not synced to satellite, in python:
client.system.schedulePackageRemoveByNevra(key,<SYSTEMID>,[{'package_name': "antlr", 'package_epoch': "0", 'package_version': "2.7.7", 'package_release': "6.5.el6", 'package_arch': "x86_64"}], datetime.now())

Actual results:
Nothing scheduled, traceback

Expected results:
Package removal scheduled

Additional info:
This operation can be done using WebUI so I think it should also be possible using API

Comment 2 Tomáš Kašpárek 2017-10-16 10:58:13 UTC
spacewalk.git(master): 641ee2ec292905c67dc93b6e40a6153fb989359c
spacewalk.git(master): f9f50d4bfddf9562dc302995753db4938fb8cbc1

Comment 8 errata-xmlrpc 2018-02-05 13:57:18 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


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