Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 652788

Summary: system.getSubscribedBaseChannel returns empty result
Product: Red Hat Satellite 5 Reporter: John Ruemker <jruemker>
Component: APIAssignee: Tomas Lestach <tlestach>
Status: CLOSED ERRATA QA Contact: Šimon Lukašík <slukasik>
Severity: medium Docs Contact:
Priority: low    
Version: 540CC: cperry, slukasik
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-20 08:22:04 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: 715348    

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