Yeela Kaplan has posted comments on this change.
Change subject: caps: raise if bridge has more than one port
......................................................................
Patch Set 2:
(2 comments)
https://gerrit.ovirt.org/#/c/46321/2/vdsm/caps.py
File vdsm/caps.py:
Line 97: host_ports = [port for port in attrs['ports'] if
Line 98: not port.startswith('vnet')]
Line 99: if not host_ports: # Port-less bridge
Line 100: continue
Line 101: if len(host_ports) > 1:
to keep the original meaning you should test for '== 1'
Done
Line 102: raise RuntimeError('bridge with more than one port')
Line 103: iface, = host_ports
Line 104: if iface in caps['vlans']:
Line 105: vlan_id = caps['vlans'][iface]['vlanid']
Line 99: if not host_ports: # Port-less bridge
Line 100: continue
Line 101: if len(host_ports) > 1:
Line 102: raise RuntimeError('bridge with more than one port')
Line 103: iface, = host_ports
now, this defense is not needed anymore so you can just extract
hots_ports[
Done
Line 104: if iface in caps['vlans']:
Line 105: vlan_id = caps['vlans'][iface]['vlanid']
Line 106: iface = caps['vlans'][iface]['iface']
Line 107: iface_qdiscs = qdiscs.get(iface)
--
To view, visit
https://gerrit.ovirt.org/46321
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I20d4b8b6e3147a29aebcbc7a68b9c92d23aa4307
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Yaniv Bronhaim
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes