Remove redundant debug logs. fuse mixin will log them.
This commit is contained in:
Родитель
c3c1dc6f67
Коммит
1f6b76e513
|
@ -155,7 +155,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
TODO: Mode is not respected at this time. Support could be added
|
||||
'''
|
||||
path = path.lstrip('/')
|
||||
logger.debug("create operation begin: path:%r mode:%s", path, mode)
|
||||
try:
|
||||
if not path:
|
||||
raise FuseOSError(errno.EINVAL)
|
||||
|
@ -167,7 +166,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
props = models.FileProperties()
|
||||
props.content_length = 0
|
||||
cached[filename] = models.File(filename, None, props)
|
||||
logger.debug("create operation end: path:%r mode:%s", path, mode)
|
||||
return 0;
|
||||
|
||||
except Exception as e:
|
||||
|
@ -236,7 +234,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
logger.warning(
|
||||
"getattr operation setting create time failed: path:%r fh:%d st:%s", path, fh, st)
|
||||
|
||||
logger.debug("getattr operation end: path:%r fh:%s return:%s", path, fh, st)
|
||||
return st
|
||||
except Exception as e:
|
||||
# This log is noisy as it occurs if the file isn't found. Only uncomment for debugging.
|
||||
|
@ -250,7 +247,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
TODO: Mode is not respected at this time. Support could be added
|
||||
'''
|
||||
path = path.lstrip('/')
|
||||
logger.debug("mkdir operation begin: path:%r mode:%s", path, mode)
|
||||
try:
|
||||
self._files_service.create_directory(
|
||||
self._azure_file_share_name, path, fail_on_exist=True)
|
||||
|
@ -260,7 +256,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
cached[filename] = models.Directory(filename)
|
||||
logger.debug("mkdir operation: %s %s", filename, cached)
|
||||
|
||||
logger.debug("mkdir operation end: path:%r mode:%s", path, mode)
|
||||
return 0
|
||||
except AzureHttpError as ahe:
|
||||
logger.exception("mkdir operation azurehttperror exception: path:%r mode:%s exception:%s", path, mode, ahe)
|
||||
|
@ -278,7 +273,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
'''
|
||||
read a file and return a buffer containing that area of the file
|
||||
'''
|
||||
logger.debug("read operation begin: path:%r size:%s offset:%s fh:%s", path, size, offset, fh)
|
||||
self.flush(path)
|
||||
try:
|
||||
dir_path, file_path = self._get_separated_path(path)
|
||||
|
@ -292,9 +286,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
else:
|
||||
raise ahe
|
||||
|
||||
logger.debug(
|
||||
"read operation end: path:%r size:%s offset:%s fh:%s data-to-return-length:%s",
|
||||
path, size, offset, fh, len(data_to_return))
|
||||
return data_to_return
|
||||
|
||||
except Exception as e:
|
||||
|
@ -326,14 +317,11 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
'''
|
||||
path = path.lstrip('/')
|
||||
|
||||
logger.debug("readdir operation begin: path:%r fh:%s", path, fh)
|
||||
try:
|
||||
directory_listing = self._get_cached_dir(path)
|
||||
|
||||
readdir_return = ['.', '..']
|
||||
readdir_return.extend(directory_listing.keys())
|
||||
logger.debug(
|
||||
"readdir operation end: path:%r fh:%s return:%s", path, fh, readdir_return)
|
||||
return readdir_return
|
||||
except Exception as e:
|
||||
logger.exception(
|
||||
|
@ -345,7 +333,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
Rename a file or directory.
|
||||
TODO: Currently this implementation does not support renaming directories. Support needed.
|
||||
"""
|
||||
logger.debug("rename operation begin: old:%r new:%r", old, new)
|
||||
try:
|
||||
old_orig_path = old
|
||||
old_path = old.strip('/')
|
||||
|
@ -386,7 +373,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
props = models.FileProperties()
|
||||
props.content_length = new_length
|
||||
cached[filename] = models.File(filename, None, props)
|
||||
logger.debug("rename operation end: old:%r new:%r", old, new)
|
||||
return 0
|
||||
except Exception as e:
|
||||
logger.exception(
|
||||
|
@ -428,7 +414,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
'''
|
||||
removes a directory at specified path
|
||||
'''
|
||||
logger.debug("rmdir operation begin: path:%r", path)
|
||||
try:
|
||||
|
||||
path = path.strip('/')
|
||||
|
@ -454,8 +439,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
# elif not response.status_code == requests.codes.ok:
|
||||
# logger.exception("rmdir operation had bad response status code:{}".format(response.status_code))
|
||||
# raise FuseOSError(errno.ENOENT)
|
||||
|
||||
logger.debug("rmdir operation end: path:%r", path)
|
||||
except Exception as e:
|
||||
logger.exception(
|
||||
"rmdir operation exception: path:%r exception:%s", path, e)
|
||||
|
@ -465,7 +448,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
'''
|
||||
Delete file.
|
||||
'''
|
||||
logger.debug("unlink operation begin: path:%r", path)
|
||||
self.flush(path)
|
||||
try:
|
||||
orig_path = path
|
||||
|
@ -479,7 +461,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
if cached is not None:
|
||||
with contextlib.suppress(KeyError):
|
||||
del cached[filename]
|
||||
logger.debug("unlink operation end: path:%r", path)
|
||||
return 0
|
||||
except AzureHttpError as ahe:
|
||||
if [i for i in ahe.args if 'The specified resource does not exist' in i]:
|
||||
|
@ -494,7 +475,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
'''
|
||||
write
|
||||
'''
|
||||
logger.debug("write operation begin: path:%r len(data):%d offset:%d fh:%d", path, len(data), offset, fh)
|
||||
try:
|
||||
orig_path = path
|
||||
path = path.lstrip('/')
|
||||
|
@ -528,8 +508,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
future.add_done_callback(done)
|
||||
|
||||
# TODO: if we ever try to cache attrs, we would have to update the st_mtime.
|
||||
|
||||
logger.debug("write operation end: path:%r len(data):%d offset:%d fh:%d return-data-length:%d", path, len(data), offset, fh, data_length)
|
||||
return data_length
|
||||
except AzureHttpError as ahe:
|
||||
if [i for i in ahe.args if 'ShareSizeLimitReached' in i]:
|
||||
|
@ -554,7 +532,6 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
See truncate(2) for details. This call is required for read/write filesystems,
|
||||
because recreating a file will first truncate it.
|
||||
'''
|
||||
logger.debug("truncate operation begin: path:%r length:%d fh:%d", path, length, fh)
|
||||
# length must be positive
|
||||
if length < 0:
|
||||
raise FuseOSError(errno.EINVAL)
|
||||
|
@ -577,10 +554,7 @@ class AzureFiles(LoggingMixIn, Operations):
|
|||
except Exception as e:
|
||||
logger.exception("truncate operation exception: path:%r length:%d fh:%d e:%s", path, length, fh, e)
|
||||
raise e
|
||||
finally:
|
||||
logger.debug("truncate operation end: path:%r length:%d fh:%d", path, length, fh)
|
||||
|
||||
|
||||
def chmod(self, path, mode):
|
||||
'''
|
||||
chmod. This command is a NOP right now.
|
||||
|
|
Загрузка…
Ссылка в новой задаче