Bug 652788 - system.getSubscribedBaseChannel returns empty result
Summary: system.getSubscribedBaseChannel returns empty result
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 540
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Šimon Lukašík
URL:
Whiteboard:
Depends On:
Blocks: sat54-blockers
TreeView+ depends on / blocked
 
Reported: 2010-11-12 19:03 UTC by John Ruemker
Modified: 2018-11-14 16:26 UTC (History)
2 users (show)

Fixed In Version: spacewalk-java-1.2.39-101
Doc Type: Bug Fix
Doc Text:
Consequence: system.getSubscribedBaseChannel API fails, if a system has no base channel Result: system.getSubscribedBaseChannel API doesn't fail, if a system has no base channel
Clone Of:
Environment:
Last Closed: 2011-10-20 08:22:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1388 0 normal SHIPPED_LIVE Red Hat Network Satellite server spacewalk-java bug fix and enhancement update 2011-10-20 08:21:14 UTC

Description John Ruemker 2010-11-12 19:03:12 UTC
Description of problem: This essentially another occurence of bug 570393, but in the system.getSubscribedBaseChannel API call.  If the system in question does not have a base channel, this call returns nothing and thus an error is seen from the script.

#!/usr/bin/perl
use Frontier::Client;

my $HOST = 'jrummy5-sat.example.com';
my $user = 'admin';
my $pass = 'xxxxxx';

my $client = new Frontier::Client(url => "http://$HOST/rpc/api");
my $session = $client->call('auth.login',$user, $pass);

my $systems = $client->call('system.getId', $session, "jrummy5-64");
foreach my $system (@$systems) {
       print $system->{'name'}.":".$system->{'id'}."\n";
       $chaninfo = $client->call('system.getSubscribedBaseChannel', $session, $system->{'id'});        
}
$client->call('auth.logout', $session); 

# ./api.pl 
jrummy5-64:1000010177

no element found at line 1, column 0, byte -1 at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/XML/Parser.pm line 187



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

How reproducible: Always

Steps to Reproduce:
1. Register host to satellite
2. Remove base channel from system
3. Run above script, using that system's name
  
Actual results: no element found at line 1, column 0, byte -1 at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/XML/Parser.pm line 187

Expected results: No error

Additional info: In bug 570393, I understand it was deemed that this problem should be fixed on the server, as the call should never return nothing.  However shouldn't we also fix the Frontier::Client so that this doesn't continue to happen for other calls that make the same mistake?

Comment 1 Tomas Lestach 2011-02-18 14:16:25 UTC
Fixed.

spacewalk.git: 4d692bb93ef6977e350439e4d949157582c4b27e

Comment 2 Tomas Lestach 2011-02-21 16:14:15 UTC
appropriate test fixed ...

spacewalk.git: 71a15c8b41a12c1d97521ea79bfda5ed94ba17a2

Comment 6 Tomas Lestach 2011-09-27 15:00:46 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Consequence:
system.getSubscribedBaseChannel API fails, if a system has no base channel
Result:
system.getSubscribedBaseChannel API doesn't fail, if a system has no base channel

Comment 8 Šimon Lukašík 2011-10-04 12:10:26 UTC
Moving to Verified:

Testing procedure:
 - automated test

Verified against:
spacewalk-java-1.2.39-101

Comment 9 errata-xmlrpc 2011-10-20 08:22:04 UTC
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/RHBA-2011-1388.html


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