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:
parent
99f64dfe1d
commit
beed6b368b
1 changed files with 1 additions and 2 deletions
|
@ -58,10 +58,9 @@ def _assert_dirs_equal_cmp(self, diff, fuse=False):
|
||||||
def wait_for_mount(self, path, timeout=5):
|
def wait_for_mount(self, path, timeout=5):
|
||||||
"""Wait until a filesystem is mounted on `path`
|
"""Wait until a filesystem is mounted on `path`
|
||||||
"""
|
"""
|
||||||
parent_dev = os.stat(os.path.dirname(path)).st_dev
|
|
||||||
timeout += time.time()
|
timeout += time.time()
|
||||||
while timeout > time.time():
|
while timeout > time.time():
|
||||||
if os.stat(path).st_dev != parent_dev:
|
if os.path.ismount(path):
|
||||||
return
|
return
|
||||||
time.sleep(.1)
|
time.sleep(.1)
|
||||||
raise Exception('wait_for_mount(%s) timeout' % path)
|
raise Exception('wait_for_mount(%s) timeout' % path)
|
||||||
|
|
Loading…
Reference in a new issue