Skip to content
Snippets Groups Projects
Commit 235151c1 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

SW-772: catch 'No such file or directory' case as non-error

parent 96bcf8e7
No related branches found
No related tags found
1 merge request!8Cobalt2 multithreading fix
...@@ -107,8 +107,14 @@ def getDiskUsageForPath_du(path): ...@@ -107,8 +107,14 @@ def getDiskUsageForPath_du(path):
result['disk_usage'] = int(parts[0]) result['disk_usage'] = int(parts[0])
result['nr_of_files'] = None result['nr_of_files'] = None
else: else:
logger.error(out + err) result['message'] = out + err
result['message'] = out result['found'] = False
if 'No such file or directory' in err:
logger.warning('No such file or directory: %s', path)
result['disk_usage'] = 0
else:
logger.error(out + err)
result['disk_usage_readable'] = humanreadablesize(result['disk_usage']) result['disk_usage_readable'] = humanreadablesize(result['disk_usage'])
......
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