Commit aa65ed72 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Log only unexpected errors in utils.FileLock

Otherwise users might be confused by errors in log files.

Reviewed-by: iustinp
parent 553f1c1d
......@@ -1217,10 +1217,11 @@ class FileLock(object):
try:
fcntl.flock(self.fd, flag)
except IOError, err:
logging.exception("fcntl.flock failed")
if err.errno in (errno.EAGAIN, ):
raise errors.LockError(errmsg)
raise
else:
logging.exception("fcntl.flock failed")
raise
def Exclusive(self, blocking=False):
"""Locks the file in exclusive mode.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment