Bug 448698 - system.getUnscheduledErrata documentation/reality mismatch
Summary: system.getUnscheduledErrata documentation/reality mismatch
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 510
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Devan Goodwin
QA Contact: Brandon Perkins
URL: https://www.redhat.com/mailman/privat...
Whiteboard:
Depends On:
Blocks: 429319
TreeView+ depends on / blocked
 
Reported: 2008-05-28 10:02 UTC by Jan Pazdziora
Modified: 2018-10-19 21:00 UTC (History)
2 users (show)

Fixed In Version: sat511
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-08-13 19:03:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Pazdziora 2008-05-28 10:02:07 UTC
Description of problem:

API call system.getUnscheduledErrata returns id and date, while the
documentations says it should also return advisory_synopsis, advisory_type,
advisory_name.

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

Satellite 5.1.0.

How reproducible:

Dterministic.

Steps to Reproduce:
1. Check
https://your-satellite/rhn/apidoc/system/SystemHandler.jsp#getUnscheduledErrata
2. Run Perl code below.
  
Actual results:

Method: getUnscheduledErrata
Description:
Provides an array of errata that are applicable to a given system.

Parameters:

    * string sessionKey
    * int serverId

Returns: array

    * struct (errata)
          o int "id" - Errata ID.
          o string "date" - Date erratum was created.
          o string "advisory_synopsis" - Summary of the erratum.
          o string "advisory_type" - type label such as Security, Bug
Fix
          o string "advisory_name" - name such as RHSA, etc.

and

$VAR1 = {
          'date' => bless( do{\(my $o = '20080527T06:00:00')},
'Frontier::RPC2::DateTime::ISO8601' ),
          'id' => '5506'
        };

Expected results:

Either the call should return all five values, or the docs should be fixed.

Additional info:

This comes from rhn-satellite-users maililng list:

Hi all

Is it just me or does system.getUnscheduledErrata not behave as
advertised?

https://your.sat.com/rhn/apidoc/system/SystemHandler.jsp#getUnscheduledE
rrata

---
Method: getUnscheduledErrata
Description:
Provides an array of errata that are applicable to a given system.

Parameters:

    * string sessionKey
    * int serverId

Returns: array

    * struct (errata)
          o int "id" - Errata ID.
          o string "date" - Date erratum was created.
          o string "advisory_synopsis" - Summary of the erratum.
          o string "advisory_type" - type label such as Security, Bug
Fix
          o string "advisory_name" - name such as RHSA, etc.
---

But when I do the following
---
-=snip=-
my $Systems = $client->call('system.listUserSystems', $session);
for my $sys (@$Systems) {
    my $Erratum = $client->call('system.getUnscheduledErrata', $session,
$sys->{'id'});
    print "$sys->{'name'} ($sys->{'id'})\n";
    for my $errata (@$Erratum) {
print Dumper $errata;
exit;
-=snip=-
---

I get the following output:
---
$VAR1 = {
          'date' => bless( do{\(my $o = '20080318T13:00:00')},
'Frontier::RPC2::DateTime::ISO8601' ),
          'id' => '1070'
        };
---

Anyone know where advisory_synopsis, advisory_type, and advisory_name
are?

CC

Comment 4 Colin Coe 2008-05-28 13:12:00 UTC
Please don't change the doco, fix the API call.  Just returning an errata ID 
isn't very helpful (I can't see a corresponding API call to match the errata ID 
to a advisory name).

CC

Comment 5 Devan Goodwin 2008-05-28 19:09:22 UTC
Fixed (by adding the expected return values) in trunk:

Sending        code/src/com/redhat/rhn/common/db/datasource/xml/Errata_queries.xml

Sending       
code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ErrataSerializer.java

Sending        code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java

Sending        code/src/com/redhat/rhn/manager/system/SystemManager.java

Sending        scripts/api/systemtests.py

Transmitting file data .....

Committed revision 173052.


Backported to 5.1:

Sending        code/src/com/redhat/rhn/common/db/datasource/xml/Errata_queries.xml
Sending       
code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ErrataSerializer.java
Sending        code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
Sending        code/src/com/redhat/rhn/manager/system/SystemManager.java
Sending        scripts/api/systemtests.py
Transmitting file data .....
Committed revision 173053.


Comment 8 Devan Goodwin 2008-06-02 16:56:20 UTC
Good points, reverted previous fix due to some technical issues, changed/fixed
xmlrpc docs and made the date return as a string in short form similar to
getRelevantErrata.

Trunk:


Sending        code/src/com/redhat/rhn/common/db/datasource/xml/Errata_queries.xml
Sending       
code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ErrataSerializer.java
Sending        code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
Sending        code/src/com/redhat/rhn/manager/system/SystemManager.java
Transmitting file data ....
Committed revision 173339.

5.1:

Sending        code/src/com/redhat/rhn/common/db/datasource/xml/Errata_queries.xml
Sending       
code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ErrataSerializer.java
Sending        code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
Sending        code/src/com/redhat/rhn/manager/system/SystemManager.java
Transmitting file data ....
Committed revision 173340.


Comment 13 Brandon Perkins 2008-08-13 19:03:57 UTC
5.1.1 Satellite is now GA, bugs Closed for Current Release.

Comment 14 Brandon Perkins 2008-08-13 19:09:00 UTC
5.1.1 Satellite is now GA, bugs Closed for Current Release.


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