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):
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
......
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