1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 09:19:31 +00:00

Simplify wait_for_mount()

This commit is contained in:
Jonas Borgström 2013-07-26 13:23:33 +02:00
parent 99f64dfe1d
commit beed6b368b

View file

@ -58,10 +58,9 @@ def _assert_dirs_equal_cmp(self, diff, fuse=False):
def wait_for_mount(self, path, timeout=5):
"""Wait until a filesystem is mounted on `path`
"""
parent_dev = os.stat(os.path.dirname(path)).st_dev
timeout += time.time()
while timeout > time.time():
if os.stat(path).st_dev != parent_dev:
if os.path.ismount(path):
return
time.sleep(.1)
raise Exception('wait_for_mount(%s) timeout' % path)