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:
|
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
|
||||||
|
|
Loading…
Reference in a new issue