Bug 496003

Summary: isNvreInstalled api without epoch is not returning correct result
Product: Red Hat Satellite 5 Reporter: Sayli Karmarkar <skarmark>
Component: APIAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED CURRENTRELEASE QA Contact: Sayli Karmarkar <skarmark>
Severity: medium Docs Contact:
Priority: low    
Version: 530CC: cperry, jsefler
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 19:55:24 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: 456996    

Description Sayli Karmarkar 2009-04-15 22:05:51 UTC
Description of problem:

>>> server.system.isNvreInstalled(key, 1000010460, "tar", "1.15.1", "23.0.1.el5")
0
>>> server.system.isNvreInstalled(key, 1000010460, "tar", "1.15.1", "23.0.1.el5", "2")
1

So, basically when I provide epoch as well, then it succeeds, but only NVR returns 0.  
  
Expected results:
It should return 1(success) in the first case also.

Comment 1 Brad Buckingham 2009-04-16 21:51:16 UTC
master git commit: e06bd36b4a119720a0b48f38e5301b157019bd17
vader git commit: 9160e27e46c0f0a1ee9409f6b1f04a10637eb8d8

>>> client.system.isNvreInstalled(key,1000013430, "tar", "1.15.1", "23.0.1.el5")
1
>>> client.system.isNvreInstalled(key,1000013430, "tar", "1.15.1", "23.0.1.el5", "2")
1

Comment 2 Brad Buckingham 2009-04-27 12:26:58 UTC
mass move to ON_QA

Comment 3 Sayli Karmarkar 2009-04-28 21:44:07 UTC
verified.

Comment 4 John Sefler 2009-08-27 20:54:53 UTC
Verified on staged (Satellite-5.3.0-RHEL5-re20090724.0) with updates from Aug 20, 2009

Created and ran the following python script against a satellite with a system that had package:
tar-1.15.1-23.0.1.el5:2

[jsefler@jsefler api]$ cat system_isNvreInstalled.py 
#!/usr/bin/env python
import xmlrpclib

u = 'admin'
p = 'redhat'
url = 'http://sun-x4200-01.rhts.bos.redhat.com/rpc/api'
server = xmlrpclib.Server(url,verbose=0)
sid = 1000010233

try:
 ses = server.auth.login(u,p)
 print "result=%d" % (server.system.isNvreInstalled(ses,sid,"tar","1.15.1","23.0.1.el4"))
 print "result=%d" % (server.system.isNvreInstalled(ses,sid,"tar","1.15.1","23.0.1.el5"))
 print "result=%d" % (server.system.isNvreInstalled(ses,sid,"tar","1.15.1","23.0.1.el5", "1"))
 print "result=%d" % (server.system.isNvreInstalled(ses,sid,"tar","1.15.1","23.0.1.el5", "2"))
except(xmlrpclib.Fault), f:
 print "ERROR: an Error was encountered!\n", f
 exit(-1)

[jsefler@jsefler api]$ ./system_isNvreInstalled.py 
result=0
result=1
result=0
result=1

moving to RELEASE_PENDING

Comment 5 Brandon Perkins 2009-09-10 19:55:24 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/RHEA-2009-1434.html