Change in vdsm[master]: net: set physical functions up before using them.
phoracek at redhat.com
phoracek at redhat.com
Fri Sep 18 09:46:36 UTC 2015
Petr Horáček has posted comments on this change.
Change subject: net: set physical functions up before using them.
......................................................................
Patch Set 2: Code-Review-1
(2 comments)
https://gerrit.ovirt.org/#/c/45639/2/vdsm/hostdev.py
File vdsm/hostdev.py:
Line 57:
Line 58:
Line 59: def physical_function_net_name(pf_pci_name):
Line 60: """takes a pci path of a physical function (e.g. pci_0000_02_00_0) and returns
Line 61: the network interface name associated with it (e.g. enp2s0f0)"""
PEP257 https://www.python.org/dev/peps/pep-0257/ wants ending """ on a separate line
Line 62: devices = list_by_caps()
Line 63: libvirt_device_names = [name for name, device in devices.iteritems()
Line 64: if device['params'].get('parent') == pf_pci_name]
Line 65: if len(libvirt_device_names) > 1:
Line 66: raise Exception('could not determine network name for %s. Possible'
Line 67: 'devices: %s' % (pf_pci_name, libvirt_device_names))
Line 68: if not libvirt_device_names:
Line 69: raise Exception('could not determine network name for %s. There are no'
Line 70: 'devices with this parent.' % (pf_pci_name,))
no need for a tuple. IIUIC % pf_pci_name is enough when parameter is a string.
Line 71:
Line 72: return libvirt_device_names[0].split('_')[1]
Line 73:
Line 74:
--
To view, visit https://gerrit.ovirt.org/45639
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib4a5ad2e51bb8d5d09647455e14905c07d8c89cb
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list