Skip to content

Commit

Permalink
Run test cases on hns
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghua committed Nov 12, 2024
1 parent b7a13e7 commit 0a8b8fd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tosfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,19 @@ def isdir(self, path: str) -> bool:
except TosServerError as e:
if e.status_code == TOS_SERVER_STATUS_CODE_NOT_FOUND:
return False
if (self._get_bucket_type(bucket) == TOS_BUCKET_TYPE_HNS
and e.status_code == CONFLICT_CODE
and e.header._store["x-tos-ec"][1] == "0026-00000020"):
out = retryable_func_executor(
lambda: self.tos_client.list_objects_type2(
bucket,
prefix=key,
delimiter="/",
max_keys=1,
),
max_retry_num=self.max_retry_num,
)
return out.key_count > 0
raise e

def isfile(self, path: str) -> bool:
Expand Down

0 comments on commit 0a8b8fd

Please sign in to comment.