This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 448698 - system.getUnscheduledErrata documentation/reality mismatch
system.getUnscheduledErrata documentation/reality mismatch
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
510
All Linux
medium Severity low
: ---
: ---
Assigned To: Devan Goodwin
Brandon Perkins
https://www.redhat.com/mailman/privat...
:
Depends On:
Blocks: 429319
  Show dependency treegraph
 
Reported: 2008-05-28 06:02 EDT by Jan Pazdziora
Modified: 2010-10-22 21:30 EDT (History)
2 users (show)

See Also:
Fixed In Version: sat511
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-08-13 15:03:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Pazdziora 2008-05-28 06:02:07 EDT
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 09:12:00 EDT
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 15:09:22 EDT
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 12:56:20 EDT
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 15:03:57 EDT
5.1.1 Satellite is now GA, bugs Closed for Current Release.
Comment 14 Brandon Perkins 2008-08-13 15:09:00 EDT
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.