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: try:
fd = open(os.path.join(log_dir, jid), 'rb') 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)', log.error('Unable to open the log file (%s)',
os.path.join(log_dir, jid), os.path.join(log_dir, jid),
exc_info=True) exc_info=True)
return return
if not fd: if not fd:
return return