Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1076559

Summary: Inconsistent parameters between API functions system.setDetails and system.getDetails
Product: Red Hat Satellite 5 Reporter: Martin Korbel <mkorbel>
Component: APIAssignee: Tomas Lestach <tlestach>
Status: CLOSED DEFERRED QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 560   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-09 11:14:09 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 462714    
Attachments:
Description Flags
test script py.py none

Description Martin Korbel 2014-03-14 14:30:57 UTC
Description of problem:
I detected  many small inconsistencies in API system.setDetails. 

Version-Release number of selected component (if applicable):
Sat5.6 (spacewalk-java-2.0.2-46)
SW2.1

How reproducible:
100%


I. Parameter 'base_entitlement' 
---------------------------------------------------------------
We have got a unmanaged system (SID:1000010000)

1. We can see, our base_entitlement is 'unentitled'.
> ./py.py 1000010000
...
'base_entitlement' => 'unentitled'
...

2. We change base_entitlement to 'enterprise_entitled'.
> ./py.py 1000010000 "base_entitlement=enterprise_entitled"
base_entitlement   unentitled -> enterprise_entitled

3. Now, we change base_entitlement back to 'unentitled'
> ./py.py "base_entitlement=unentitled"
base_entitlement   enterprise_entitled -> enterprise_entitled

4. We can see the last step nothing changed.
Problem is it, function setDetails does not accept  'unentitled', but only 'unentitle'.
> ./py.py 1000010000 "base_entitlement=unentitle"
base_entitlement   enterprise_entitled -> unentitled


Next problem, what is close to this.
In WebUI (/rhn/systems/details/Edit.do?sid=1000010000), we can see 

if we have a managed system:
 Base Entitlement: - Management (value=enterprise_entitled)
                   - Unentitle System (value=unentitle)

if we have a unmanaged system:
 Base Entitlement: - None (value=none)
                   - Management (value=enterprise_entitled)                   


Question is it, Why is here this option None (value=none) and is not option Unentitle System (value=unentitle)?

In API documentation (/rhn/apidoc/handlers/SystemHandler.jsp#setDetails), there is 
string "base_entitlement" - System's base entitlement label. (enterprise_entitled or sw_mgr_entitled) 

When we try:
> ./py.py 1000010000 "base_entitlement=sw_mgr_entitled"
base_entitlement   enterprise_entitled -> unentitled

My bet is that, sw_mgr_entitled = unentitled. But, when we try to found this notion 'sw_mgr_entitled' in the documentation, 0 results.
Please, can you update documentation and write better description of this parameter. 



II. Parameter 'auto_update' 
---------------------------------------------------------------
1. We can see, our auto_update is False.
> ./py.py 1000010000
...
'auto_update': False
...

2. We try to change auto_update to True
> ./py.py 1000010000 "auto_update=True"
Traceback (most recent call last):
...

3. We got traceback, because parameter 'auto_update' does not exist. We have to use 'auto_errata_update' parameter.
> ./py.py 1000010000 "auto_errata_update=True"
auto_errata_update   None -> None

The API function 'setDetails' should accept parameter 'auto_update' too.



III. Parameter 'country' 
---------------------------------------------------------------
1. We can see, our country is empty.
> ./py.py 1000010000
...
'country': ''
...

2. We change 'country' to 'US'
> ./py.py 1000010000 "country=US"
country    -> US

3. Now, We want to change 'country' to empty value.
>./py.py 1000010000 "country="
Traceback (most recent call last):
...

We have no chance to change parameter to empty value using API (using WebUI, it is possible).



Summary:
 - API function setDetails should accept base_entitlement=unentitled, because it is value, what getDetails returns.
 - Change option None (value=none) to option Unentitle System (value='unentitle', may be 'unentitled') for 'Base Entitlement' attribute in WebUI.
 - The API function 'setDetails' should accept parameter 'auto_update' too.

 - Update function getDetails in the documentation.
 - The API function 'setDetails' should accept parameter 'auto_update' too.
 - The API function 'setDetails' should accept empty parameter 'country'.

Comment 1 Martin Korbel 2014-03-14 14:31:42 UTC
Created attachment 874449 [details]
test script py.py

Comment 2 Tomas Lestach 2018-04-09 11:14:09 UTC
We have re-reviewed this bug, as part of an ongoing effort to improve Satellite/Proxy feature and bug updates, review and backlog.

This is a low priority bug and has no currently open customer cases. While this bug may still valid, we do not see it being implemented prior to the EOL of the Satellite 5.x product. As such, this is being CLOSED DEFERRED. 

Closing now to help set customer expectations as early as possible. You are welcome to re-open this bug if needed.