Skip to content
Snippets Groups Projects
Commit 1dd18017 authored by Florent Thiery's avatar Florent Thiery
Browse files

limit to 1 depth, refs #21677

parent f6cd0f7f
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,7 @@ def test_backup_space(server): ...@@ -67,7 +67,7 @@ def test_backup_space(server):
return False return False
def check_local_backup(path): def check_local_backup(path, descend=True):
all_ok = True all_ok = True
for d in os.listdir(path): for d in os.listdir(path):
subd = os.path.join(path, d) subd = os.path.join(path, d)
...@@ -85,10 +85,11 @@ def check_local_backup(path): ...@@ -85,10 +85,11 @@ def check_local_backup(path):
else: else:
print('Backup %s is fine' % subd) print('Backup %s is fine' % subd)
else: else:
for dd in os.listdir(subd): if descend:
subsubd = os.path.join(subd, dd) for dd in os.listdir(subd):
if os.path.isdir(subsubd): subsubd = os.path.join(subd, dd)
all_ok = min(all_ok, check_local_backup(subsubd)) if os.path.isdir(subsubd):
all_ok = min(all_ok, check_local_backup(subsubd, descend=False))
return all_ok return all_ok
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment