Bug 488999 - channel.software.setUserSubscribable accepts values other than 'true' and 'false' for value
Summary: channel.software.setUserSubscribable accepts values other than 'true' and 'fa...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 530
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Brad Buckingham
QA Contact: Sayli Karmarkar
URL:
Whiteboard:
Depends On:
Blocks: 456996
TreeView+ depends on / blocked
 
Reported: 2009-03-06 17:15 UTC by Sayli Karmarkar
Modified: 2015-03-23 01:09 UTC (History)
2 users (show)

Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-10 19:54:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sayli Karmarkar 2009-03-06 17:15:58 UTC
Description of problem:
channel.software.setUserSubscribable accepts values other than 'true' and 'false' for value. API should give an error saying 'invalid entry for value'

How reproducible:
>>> server.channel.software.setUserSubscribable(key, 'foobar', 'autoTestUser573', 'false')
1

>>> server.channel.software.setUserSubscribable(key, 'foobar', 'autoTestUser573', 'randomValue')
1

Expected results:
API should give an error saying 'invalid entry for value'

Comment 1 Sayli Karmarkar 2009-03-06 22:12:24 UTC
Also, api docs say: "string" value

Method: setUserSubscribable
Description:
Set the subscribable flag for a given channel and user. If value is set to 'true', this method will give the user subscribe permissions to the channel. Otherwise, that privilege is revoked.

Parameters:

    * string sessionKey
    * string channelLabel - label of the channel
    * string login - login of the target user
    * string value - value of the flag to set  <<<----

where actual signature of API accepts boolean value. 


~SayliK

Comment 2 Brad Buckingham 2009-03-06 22:31:17 UTC
git commit: b9e7ce2cc164bbff57bf2197c347ccdde98cd6c8

API updated to take a Boolean as input (instead of primitive boolean).  As a result, if API is executed with python should use format similar to:

>>> client.channel.software.setUserSubscribable(key, 'rhel-x86_64-server-5', 'bbuckingham', True)
1
>>> client.channel.software.setUserSubscribable(key, 'rhel-x86_64-server-5', 'bbuckingham', False)
1
>>> 


Docs updated to reflect that 'value' is a boolean type:

Method: setUserSubscribable
Description:
Set the subscribable flag for a given channel and user. If value is set to 'true', this method will give the user subscribe permissions to the channel. Otherwise, that privilege is revoked.

Parameters:

    * string sessionKey
    * string channelLabel - label of the channel
    * string login - login of the target user
    * boolean value - value of the flag to set

Returns:

    * int - 1 on success, exception thrown otherwise.

Comment 3 Brad Buckingham 2009-03-17 21:17:48 UTC
mass move to ON_QA

Comment 4 Sayli Karmarkar 2009-03-18 20:16:14 UTC
verified.

Comment 5 Michael Mráka 2009-08-27 10:29:31 UTC
Verified in stage -> RELEASE_PENDING.


$ ./xmlrpc-client.pl dell-pem710-01.rhts.eng.bos.redhat.com admin xxx channel.software.setUserSubscribable rhel-i386-server-5 user1 true
OK
$ ./xmlrpc-client.pl dell-pem710-01.rhts.eng.bos.redhat.com admin xxx channel.software.setUserSubscribable rhel-i386-server-5 user1 false
OK
$ ./xmlrpc-client.pl dell-pem710-01.rhts.eng.bos.redhat.com admin xxx channel.software.setUserSubscribable rhel-i386-server-5 user1 asdf
Fault returned from XML RPC Server, fault code -1: com.redhat.rhn.common.translation.TranslationException: Could not find translator for class java.lang.String to class java.lang.Boolean


Method: setUserSubscribable
Description:
Set the subscribable flag for a given channel and user. If value is set to 'true', this method will give the user subscribe permissions to the channel. Otherwise, that privilege is revoked. 

Parameters:
string sessionKey 
string channelLabel - label of the channel 
string login - login of the target user 
boolean value - value of the flag to set 

Returns: 
int - 1 on success, exception thrown otherwise.

Comment 6 Brandon Perkins 2009-09-10 19:54:46 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html


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