Bug 844048

Summary: RFE: errata.listPackages API shall return associated package list also for unpublished errata
Product: Red Hat Satellite 5 Reporter: Dimitar Yordanov <dyordano>
Component: APIAssignee: Tomas Lestach <tlestach>
Status: CLOSED CURRENTRELEASE QA Contact: Dimitar Yordanov <dyordano>
Severity: low Docs Contact:
Priority: medium    
Version: 550CC: cperry, mkorbel
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-01 21:44:39 UTC Type: Bug
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: 924158    

Description Dimitar Yordanov 2012-07-28 10:37:25 UTC
Description of problem:
API call "errata.listPackages" retunts no result if the erratum is unpublished.

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

How reproducible:
100%

Steps to Reproduce:
1. Create Custom channel "aaaaaa"
2. With the help of "rhnpush" push two packages in the channel.
3. Create errata "test_erratum"
4. Execute the following script

import sys, xmlrpclib
RHN_SERVER='https://xxx/rpc/api'
RHN_USER='xxx'
RHN_PASS='xxxx'

client = xmlrpclib.Server(RHN_SERVER, verbose=0)
key = client.auth.login(RHN_USER, RHN_PASS)

ERRATA='test_erratum'
pkg=client.channel.software.listAllPackages(key,'aaaaaa')

client.errata.listPackages(key,ERRATA)
client.errata.addPackages(key,ERRATA,[pkg[0]['id'],pkg[1]['id']])
client.errata.listPackages(key,ERRATA)
client.errata.listUnpublishedErrata(key)
client.errata.publish(key,ERRATA,['aaaaaa'])
client.errata.listPackages(key,ERRATA)
client.errata.delete(key,ERRATA)  

Actual results:
API call "errata.listPackages"  returns empty list of packages if erratum is not published.

Expected results:
API call "errata.listPackages" returns the list of packages even if erratum is not published.

Additional info:
This could be a regresion. The behaviour the same for Sat 5.4.1 and Sat 5.5.0.
Accorging to JUnit test:
http://svn.rhndev.redhat.com/viewcvs/trunk/qa/rpcapi/600/java/src/com/redhat/rhn/rpc/api/errata/addPackages.java?rev=205855&view=markup

at some point it was working.

Comment 1 Tomas Lestach 2012-07-30 09:47:17 UTC
Definitely not a regression. We never had the code that would support package list of unpublished errata within the errata.listPackages API.

Comment 2 Tomas Lestach 2012-08-01 14:45:02 UTC
changing in upstream ...

spacewalk.git: c423f11113abca0b3293468c170ac09f1c7c4fba


844048 - let errata.listPackages API return also packages associated with unpublished errata
    
 - changing hibernate mappings from date to timestamp to keep the time within the dates in the API output
 - removing unused methods and query
 - list of errata packages get taken out of hibernate objects instead of making additional cached statement queries and creating extra dto objects (side effect: faster API)

Comment 5 Clifford Perry 2013-10-01 21:40:15 UTC
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