From 1dd18017fb834306cc799d31a67bf9dc3cb25fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florent=20Thi=C3=A9ry?= <florent.thiery@ubicast.eu> Date: Thu, 1 Jun 2017 11:24:53 +0200 Subject: [PATCH] limit to 1 depth, refs #21677 --- tests/test_backup.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_backup.py b/tests/test_backup.py index 7497a8cb..e2b5de49 100755 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -67,7 +67,7 @@ def test_backup_space(server): return False -def check_local_backup(path): +def check_local_backup(path, descend=True): all_ok = True for d in os.listdir(path): subd = os.path.join(path, d) @@ -85,10 +85,11 @@ def check_local_backup(path): else: print('Backup %s is fine' % subd) else: - for dd in os.listdir(subd): - subsubd = os.path.join(subd, dd) - if os.path.isdir(subsubd): - all_ok = min(all_ok, check_local_backup(subsubd)) + if descend: + for dd in os.listdir(subd): + subsubd = os.path.join(subd, dd) + if os.path.isdir(subsubd): + all_ok = min(all_ok, check_local_backup(subsubd, descend=False)) return all_ok -- GitLab