When reading logs, don’t consider a non-existing file as an error.
This commit is contained in:
parent
ae7c506477
commit
9770a40e5f
1 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue