Bug 1186355 - system.listVirtualGuests do not return all fields for guests which are not registered
Summary: system.listVirtualGuests do not return all fields for guests which are not re...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 570
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: sat570-triage
TreeView+ depends on / blocked
 
Reported: 2015-01-27 13:57 UTC by Jan Hutař
Modified: 2015-01-28 13:42 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-28 13:42:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Hutař 2015-01-27 13:57:22 UTC
Description of problem:
API call system.listVirtualGuests do not return all fields for guests which are not registered


Version-Release number of selected component (if applicable):
Satellite 5.7.0 - spacewalk-java-2.3.8-96.el6sat.noarch


How reproducible:
always


Steps to Reproduce:
1. Check API docs on https://<fqdn>/rhn/apidoc/handlers/SystemHandler.jsp#listVirtualGuests
2. Take a host with one guest registered and another one not registered
3. Check Systems -> <host> -> Virtualization -> Details
   Guest     System                 Status   Current Memory  vCPUs  Base Software Channel
   system-1  localhost.localdomain  Running  512.0 MB        1      Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)
   system-2  Unregistered System    Running  1024.0 MB       1      (none) 
4. Run print client.system.listVirtualGuests(key, serverId)


Actual results:
[
  {'guest_name': 'system-1', 'last_checkin': <DateTime '20150117T07:26:40' at 7f148f5323b0>, 'uuid': 'e336fbeb9da72c5ad0084baf7bb4edfa', 'name': 'localhost.localdomain', 'id': 1000010034},
  {'guest_name': 'system-2', 'uuid': '6346b8cc1c6e7e172a1078cc8cf3f2ab', 'id': 1000010077}
]

Expected results:
Maybe some None values should be there for "name" and "last_checkin". Or maybe some note in documentation that these fields will not appear in 100% of cases.


Additional info:
Also there is a small typo in the docs text "guests for agiven" -> "guests for a given".

Comment 1 Tomas Lestach 2015-01-28 13:42:48 UTC
JanH,
I do not agree this is a bug.
This behavior was introduced in SerializerHelper at the beginning of Spacewalk ...

git show c43c7764d22ca8a78fd6f446b0892b6dec5e78a8:java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/util/SerializerHelper.java

The fact null values are omitted from serialization process prevents the API calls to fail as xmlrpc cannot handle null values.
If we would like to add it to documentation, we'd need to update all the calls that use add/genMember method of SerializerHelper (over 80 Serializers). I think this would only harm the current transparent apidoc. I do not want to do that.

Closing as WONTFIX.


I however fixed the typo ... 88f2c0e4


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