Merge pull request #47698 from isbm/isbm-prevent-crash-master-nonroot

Bugfix: crash when master runs as non-root
This commit is contained in:
Mike Place 2018-05-18 10:09:31 -05:00 committed by GitHub
commit f5e3f3e9e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -444,7 +444,10 @@ def clean_old_jobs():
hours_difference = (time.time() - jid_ctime) / 3600.0
if hours_difference > __opts__['keep_jobs'] and os.path.exists(t_path):
# Remove the entire f_path from the original JID dir
shutil.rmtree(f_path)
try:
shutil.rmtree(f_path)
except OSError as err:
log.error('Unable to remove %s: %s', t_path, err)
# Remove empty JID dirs from job cache, if they're old enough.
# JID dirs may be empty either from a previous cache-clean with the bug