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): ...@@ -1217,10 +1217,11 @@ class FileLock(object):
try: try:
fcntl.flock(self.fd, flag) fcntl.flock(self.fd, flag)
except IOError, err: except IOError, err:
logging.exception("fcntl.flock failed")
if err.errno in (errno.EAGAIN, ): if err.errno in (errno.EAGAIN, ):
raise errors.LockError(errmsg) raise errors.LockError(errmsg)
raise else:
logging.exception("fcntl.flock failed")
def Exclusive(self, blocking=False): def Exclusive(self, blocking=False):
"""Locks the file in exclusive mode. """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