Bug 687903 - API Documentation for system.isNvreInstalled
API Documentation for system.isNvreInstalled
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
541
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tomáš Kašpárek
Martin Minar
: EasyFix
Depends On:
Blocks: sat560-lowbug
  Show dependency treegraph
 
Reported: 2011-03-15 13:11 EDT by Stephan Dühr
Modified: 2016-07-03 20:56 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-01 17:56:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Stephan Dühr 2011-03-15 13:11:44 EDT
Description of problem:

API Documentation for system.isNvreInstalled says:

Returns:

    * int - 1 on success, exception thrown otherwise. 

That is incorrect, it does not throw an exception,
instead 0 is returned if the given package is not installed.

Version-Release number of selected component (if applicable):

spacewalk-java-1.2.39-35.1.el5sat

How reproducible:

call system.isNvreInstalled with a package that is not
installed on the target system. It will return 0.

Look at
https://your.rhn.sat/rhn/apidoc/handlers/SystemHandler.jsp#isNvreInstalled

Steps to Reproduce:
1. call system.isNvreInstalled
2. Look at API Documentation for system.isNvreInstalled
3.
  
Actual results:

Returns:

    * int - 1 on success, exception thrown otherwise. 


Expected results:

Returns:

    * int - 1 if the package is installed, 0 otherwise. 


Additional info:

Alternatively, the API could be changed to behave as documented.
I think the documentation should be corrected. An exception should
only be thrown if an error occured so that it could not be determined
if the package is installed or not.
Comment 1 Stephan Dühr 2011-03-15 13:15:15 EDT
Here is an example:

>>> r = client.system.isNvreInstalled(session, 1000011088, "rpm-python", "4.4.2.3","18.el5")
>>> r
1
>>> r = client.system.isNvreInstalled(session, 1000011088, "rpm-python", "4.4.5.3","18.el5")
>>> r
0
Comment 2 Tomas Lestach 2011-03-23 07:25:30 EDT
NoSuchSystemException is thrown, when you specify non-existing serverId. But right, information about 0 value returned is missing.
Comment 3 Stephan Dühr 2012-08-16 08:25:15 EDT
This is not yet correctly documented in Satellite 5.4.1 and also in Spacewalk 1.7 (don't know about 1.8).
Comment 4 Tomáš Kašpárek 2013-06-25 04:05:31 EDT
committed changes of documentation to spacewalk.git: 63a8f286ff671908440b21473a3112fdd534474f
Comment 7 Clifford Perry 2013-10-01 17:56:54 EDT
Satellite 5.6 has been released. This bug was tracked under the release.  

This bug was either VERIFIED or RELEASE_PENDING (re-verified prior shortly
before release). 

Moving to CLOSED CURRENT_RELEASE. 

Text from Upgrade Erratum follows:

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/RHEA-2013-1395.html

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