Bug 1250381 - python SDK: host_nic returns incomplete HostNIC object
python SDK: host_nic returns incomplete HostNIC object
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi (Show other bugs)
3.5.1
Unspecified Unspecified
low Severity low
: ---
: 3.6.0
Assigned To: Juan Hernández
Pavel Stehlik
network
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-05 05:21 EDT by Pavel Zhukov
Modified: 2018-05-02 03:32 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-17 10:22:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Network
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Pavel Zhukov 2015-08-05 05:21:40 EDT
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 10:22:10 EDT
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.