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?
Fixed. spacewalk.git: 4d692bb93ef6977e350439e4d949157582c4b27e
appropriate test fixed ... spacewalk.git: 71a15c8b41a12c1d97521ea79bfda5ed94ba17a2
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
Moving to Verified: Testing procedure: - automated test Verified against: spacewalk-java-1.2.39-101
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