Bug 488999 - channel.software.setUserSubscribable accepts values other than 'true' and 'false' for value
channel.software.setUserSubscribable accepts values other than 'true' and 'fa...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
530
All Linux
low Severity medium
: ---
: ---
Assigned To: Brad Buckingham
Sayli Karmarkar
:
Depends On:
Blocks: 456996
  Show dependency treegraph
 
Reported: 2009-03-06 12:15 EST by Sayli Karmarkar
Modified: 2015-03-22 21:09 EDT (History)
2 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-10 15:54:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sayli Karmarkar 2009-03-06 12:15:58 EST
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 17:12:24 EST
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 17:31:17 EST
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 17:17:48 EDT
mass move to ON_QA
Comment 4 Sayli Karmarkar 2009-03-18 16:16:14 EDT
verified.
Comment 5 Michael Mráka 2009-08-27 06:29:31 EDT
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 15:54:46 EDT
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.