Dan Kenigsberg has posted comments on this change.
Change subject: network: ifcfg: synchronous ifup
......................................................................
Patch Set 1: Code-Review-1
(3 comments)
more interesting use case would be to block ifup for ALL networks together. but we can
start with this.
http://gerrit.ovirt.org/#/c/37366/1/vdsm/network/configurators/ifcfg.py
File vdsm/network/configurators/ifcfg.py:
Line 856: for octet in netmask])
Line 857:
Line 858:
Line 859: @contextmanager
Line 860: def _event_sniffer(expected_event, timeout=10):
begs to be called _wait_for_event()
why do we want a timeout in the synchronous path?
Line 861: mon = monitor.Monitor(groups=('link', 'ipv4-ifaddr',
'ipv6-ifaddr'),
Line 862: timeout=timeout)
Line 863: mon.start()
Line 864: try:
Line 875: else:
Line 876: raise
Line 877:
Line 878:
Line 879: def _is_subdict(subset, superset):
subset->subdict
Line 880: return all(item in superset.items() for item in subset.items())
Line 881:
Line 882:
Line 883: def configuredPorts(nets, bridge):
Line 876: raise
Line 877:
Line 878:
Line 879: def _is_subdict(subset, superset):
Line 880: return all(item in superset.items() for item in subset.items())
this code is of O(n^2) complexity. It's harmless for our n=5, but it's not
honorable. convert the dicts.items to frozensets and use subset for linear complexity.
Line 881:
Line 882:
Line 883: def configuredPorts(nets, bridge):
Line 884: """Returns the list of ports a bridge has"""
--
To view, visit
http://gerrit.ovirt.org/37366
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I0c90a556f5fc52c1b8e675986ac39b6032ca0197
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes