--- common/snapshots.py.old 2010-02-06 11:44:47.000000000 +0100 +++ common/snapshots.py 2010-02-06 17:13:49.000000000 +0100 @@ -26,6 +26,7 @@ import bz2 import pwd import grp +import errno import config import configfile @@ -37,6 +38,15 @@ _=gettext.gettext +def temp_failure_retry(func, *args, **kwargs): + while True: + try: + return func(*args, **kwargs) + except (os.error, IOError), ex: + if ex.errno == errno.EINTR: + continue + else: + raise class Snapshots: def __init__( self, cfg = None ): @@ -893,7 +903,7 @@ pipe = os.popen( cmd, 'r' ) while True: - line = pipe.readline() + line = temp_failure_retry(pipe.readline) if len( line ) == 0: break callback( line.strip(), user_data ) @@ -915,7 +925,7 @@ pipe = os.popen( cmd, 'r' ) while True: - line = pipe.readline() + line = temp_failure_retry(pipe.readline) if len( line ) == 0: break output = output + line