When reading logs, don’t consider a non-existing file as an error.

This commit is contained in:
Emmanuel Gil Peyrot 2015-05-06 00:49:11 +02:00
parent ae7c506477
commit 9770a40e5f

View file

@ -117,10 +117,15 @@ class Logger(object):
try:
fd = open(os.path.join(log_dir, jid), 'rb')
except:
except FileNotFoundError:
log.info('Non-existing log file (%s)',
os.path.join(log_dir, jid),
exc_info=True)
return
except OSError:
log.error('Unable to open the log file (%s)',
os.path.join(log_dir, jid),
exc_info=True)
os.path.join(log_dir, jid),
exc_info=True)
return
if not fd:
return