Bug 455312

Summary: system.setChildChannels only works on one channel at a time.
Product: [Retired] Red Hat Network Reporter: Stephen Herr <sherr>
Component: RHN/BackendAssignee: rhn-dev-list
Status: CLOSED NOTABUG QA Contact: Red Hat Network Quality Assurance <rhn-qa-list>
Severity: low Docs Contact:
Priority: low    
Version: rhn505CC: rhn-bugs, sskracic
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: us=35803
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-21 14:50:44 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:
Attachments:
Description Flags
perl api test for system.setChildChannels none

Description Stephen Herr 2008-07-14 19:33:23 UTC
Description of problem:
The system.setChildChannels API method is supposed to accept an "array" of
arguments according to the published API. The purpose being so you can subscribe
to more than one child channel per call. The backend functionality does not
work; it throws an error. See system.deleteSystems for an example of a working
method that accepts an array as an argument. We can either 1) make the list
functionality work or 2) change the api to correctly identify that you can only
operate on one channel at a time.

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

How reproducible:
Always

Steps to Reproduce:
1. Run attached perl script.
  
Actual results:
Fault returned from XML RPC Server, fault code -2: unhandled internal exception:
java.lang.Integer

Expected results:
2    (indicating both channels were successfully subscribed)

Additional info:

Comment 1 Stephen Herr 2008-07-14 19:33:23 UTC
Created attachment 311761 [details]
perl api test for system.setChildChannels

Comment 2 Stephen Herr 2008-07-14 19:41:51 UTC
Here's the stack trace of this error when the Java automated tests run into it:
org.apache.xmlrpc.XmlRpcException: unhandled internal exception:
java.lang.Integer at
org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeException(Unknown Source)
at org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeResponse(Unknown
Source) at org.apache.xmlrpc.XmlRpcClientWorker.execute(Unknown Source) at
org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source) at
org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source) at
org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source) at
com.redhat.rhn.rpc.api.system.setChildChannels.testSystemSetChildChannels(setChildChannels.java:136)

Comment 4 Sebastian Skracic 2010-12-21 14:50:44 UTC
# python /git/rhn-hosted/java/rhn/xml_rpc_api/callAnyMethod.py sskracicgit *** system.setChildChannels 1013709385 "[9131, 6961]"
========================================
Calling: system.setChildChannels
With args:
[1013709385, [9131, 6961]]
========================================
Returned:
1

# python /git/rhn-hosted/java/rhn/xml_rpc_api/callAnyMethod.py sskracicgit *** channel.software.listSystemChannels 1013709385 
========================================
Calling: channel.software.listSystemChannels
With args:
[1013709385]
========================================
Returned:
[{'channel_label': 'rhel-x86_64-server-sap-5',
  'channel_name': 'RHEL AP for SAP (v. 5 for 64-bit x86_64)'},
 {'channel_label': 'rhel-x86_64-server-productivity-5',
  'channel_name': 'RHEL Optional Productivity Apps (v. 5 for 64-bit x86_64)'},
 {'channel_label': 'rhel-x86_64-server-5',
  'channel_name': 'Red Hat Enterprise Linux (v. 5 for 64-bit x86_64)'}]


Therefore, the limitation is in the client tool, not API.