]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Add a utility function run.wait to wait for processes to exit.
authorTommi Virtanen <tommi.virtanen@dreamhost.com>
Tue, 24 May 2011 20:07:24 +0000 (13:07 -0700)
committerTommi Virtanen <tommi.virtanen@dreamhost.com>
Tue, 24 May 2011 20:07:24 +0000 (13:07 -0700)
orchestra/run.py

index d82ac655ab69b3f58cc5cb1573b4f692d962694e..14fac5795402930f8b14c9dc0d33463966ca0229 100644 (file)
@@ -234,3 +234,14 @@ def run(
         r.exitstatus = spawn_asyncresult(_check_status, r.exitstatus)
 
     return r
+
+
+def wait(processes):
+    """
+    Wait for all given processes to exit.
+
+    Raise if any one of them fails.
+    """
+    for proc in processes:
+        assert isinstance(proc.exitstatus, gevent.event.AsyncResult)
+        proc.exitstatus.get()