From ce5ecdf5c2acae0ad6c386d9bb45dedee2ec44d1 Mon Sep 17 00:00:00 2001 From: yanghua Date: Sat, 28 Sep 2024 15:28:53 +0800 Subject: [PATCH] Bug: Fix TOS_TAG_ENABLED does not take effort --- tosfs/core.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tosfs/core.py b/tosfs/core.py index 1e35f03..6a7bc9e 100644 --- a/tosfs/core.py +++ b/tosfs/core.py @@ -39,6 +39,7 @@ from tosfs.consts import ( APPEND_OPERATION_SMALL_FILE_THRESHOLD, + ENV_NAME_TOS_BUCKET_TAG_ENABLE, ENV_NAME_TOS_SDK_LOGGING_LEVEL, ENV_NAME_TOSFS_LOGGING_LEVEL, FILE_OPERATION_READ_WRITE_BUFFER_SIZE, @@ -206,8 +207,11 @@ def __init__( if version_aware: raise ValueError("Currently, version_aware is not supported.") - self.tag_enabled = os.environ.get("TOS_TAG_ENABLED", True) + self.tag_enabled = ( + os.environ.get(ENV_NAME_TOS_BUCKET_TAG_ENABLE, "true").lower() == "true" + ) if self.tag_enabled: + logger.debug("The tos bucket tag is enabled.") self._init_tag_manager() self.version_aware = version_aware