Merge "executor: prevent false positive diskaccountant warning"

This commit is contained in:
Zuul 2021-01-14 20:55:56 +00:00 committed by Gerrit Code Review
commit 340063b25e
1 changed files with 3 additions and 0 deletions

View File

@ -120,6 +120,9 @@ class DiskAccountant(object):
:param callable usage_func: Optional function to call with usage
for every dir _NOT_ over limit
'''
# Remove any trailing slash to ensure dirname equality tests work
cache_dir = cache_dir.rstrip('/')
jobs_base = jobs_base.rstrip('/')
# Don't cross the streams
if cache_dir == jobs_base:
raise Exception("Cache dir and jobs dir cannot be the same")