Bug 1250381 - python SDK: host_nic returns incomplete HostNIC object
Summary: python SDK: host_nic returns incomplete HostNIC object
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.5.1
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 3.6.0
Assignee: Juan Hernández
QA Contact: Pavel Stehlik
URL:
Whiteboard: network
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-05 09:21 UTC by Pavel Zhukov
Modified: 2019-07-11 09:46 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-17 14:22:10 UTC
oVirt Team: Network
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Pavel Zhukov 2015-08-05 09:21:40 UTC
Description of problem:
get_name() called for HostNIC object which was returned by get_slaves() returns None regardless NIC has name or not.

Example:
bond_nics = [slave.host_nic for slave in [nic.get_bonding().slaves for nic in hostnics if nic.get_bonding()]]
merged_nics = list(itertools.chain.from_iterable(bond_nics))
print [nic.get_name() for nic in merged_nics]
## OUTPUT [None, None]

Workaround:
bond_nics = [slave.host_nic for slave in [nic.get_bonding().slaves for nic in hostnics if nic.get_bonding()]]
merged_nics = list(itertools.chain.from_iterable(bond_nics))
bond_slaves_names = [host.nics.get(id = nic.get_id()).get_name() for nic in merged_nics]
print bond_slaves_names
## OUTPUT: ['ens8', 'ens9']

Version-Release number of selected component (if applicable):
rhevm-sdk-python-3.5.2.1-1.el6ev.noarch

How reproducible:
100%

Actual results:
See desctiption

Additional info:

Comment 1 Juan Hernández 2015-08-17 14:22:10 UTC
The Python SDK is returning a Python object with the same content that the RESTAPI server returned, so this isn't a Python SDK issue.

In this particular case the object returned by the RESTAPI doesn't contain the full representation of the slave NICs, just a link, as the complete representation is already available in another place.


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