Change in vdsm[master]: ipwrapper, configurators: Wait for bonds to go up

asegurap at redhat.com asegurap at redhat.com
Wed May 14 13:31:25 UTC 2014


Antoni Segura Puimedon has posted comments on this change.

Change subject: ipwrapper, configurators: Wait for bonds to go up
......................................................................


Patch Set 8: Code-Review-1

(1 comment)

What about the snippet I put?

I would appreciate a bit more explanation in the commit_msg

http://gerrit.ovirt.org/#/c/26930/8/lib/vdsm/ipwrapper.py
File lib/vdsm/ipwrapper.py:

Line 705:     thread.join(TIMEOUT)
Line 706:     monitor.stop()
Line 707:     if thread.is_alive():
Line 708:         raise IfUpTimeout()
Line 709: 
What about something like (snippet not tested)

@contextlib.contextmanager
def waitForLinkUp(iface, timeout=3):
    monitor = Monitor()
    monitor.start()
    thread = threading.Thread(target=_waitingThread, args=(iface, monitor),
                              daemon=False)
    thread.start()
    try:
        yield
    except Exception:
        raise
    finally:
        thread.join(timeout)
        monitor.stop()
        if thread.is_alive():
            raise IfUpTimeout()

so that then in the configurators you could just do:
    with waitForLinkUp(bond.name):
        self.configApplier.setIfaceConfigAndUp(bond)
Line 710: 
Line 711: def _dev_sysfs_exists(devName):


-- 
To view, visit http://gerrit.ovirt.org/26930
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifcf52b33e8efd7eeecd665dacf9b156cd197c066
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list