Bug 1378879

Summary: The API system.upgradeEntitlement does not work
Product: [Community] Spacewalk Reporter: Martin Korbel <mkorbel>
Component: APIAssignee: Jiří Dostál <jdostal>
Status: CLOSED CURRENTRELEASE QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.5CC: eherget, galtukho, jdostal, lhellebr
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-java-2.6.35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1395869 (view as bug list) Environment:
Last Closed: 2017-09-27 19:21:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1395869, 1484117    

Description Martin Korbel 2016-09-23 12:38:39 UTC
Description of problem:
API method system.upgradeEntitlement does not work.

Version-Release number of selected component (if applicable):
spacewalk-java-2.5.93-1.el6
spacewalk-java-2.6.31-1.el6

How reproducible:
100%

Steps to Reproduce:
1. We have got a satellite with registered systems
2. We choose one with base channel (no virtual guest) and try to setup "virtualization" entitlement by WebUI. It should pass it. 
3. Remove "virtualization" entitlement from this profile.
3. Now we can try it again for the same profile by API
> spacewalk-api --server=localhost --user=admin --password=xxx system.upgradeEntitlement "%session%" 1000010059 'virtualization_host'

Actual results:
Fault returned from XML RPC Server, fault code -1: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: com.redhat.rhn.domain.entitlement.VirtualizationEntitlement cannot be cast to java.lang.String

Expected results:
$result = '1';

Additional info:
Maybe there are some relation with bz1378873.

Comment 1 Jiří Dostál 2016-09-27 13:49:10 UTC
spacewalk.git d4680f87655e139fe4d3cecb5319a8ed3ed65dbd

Comment 2 Lukáš Hellebrandt 2016-11-11 11:43:14 UTC
Verified with SW nightly from 2016-11-10.

Used reporoducer from OP:


# spacewalk-api --server=localhost --user=admin --password=nimda system.upgradeEntitlement "%session%" 1000010000 'virtualization_host'

$result = '1';

Comment 3 Eric Herget 2017-09-27 19:21:40 UTC
This looks like it was fixed in previous release, but I'm closing it in this one.

Spacewalk 2.7 has been released.

https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes27