mirror of
https://github.com/clearml/clearml
synced 2025-06-23 01:55:38 +00:00
Fix StorageManager.list(“s3://..”, with_metadata=True)
doesn't work
This commit is contained in:
parent
035a76e282
commit
0b0fd55329
@ -611,6 +611,7 @@ class StorageHelper(object):
|
|||||||
"""
|
"""
|
||||||
if not obj:
|
if not obj:
|
||||||
return None
|
return None
|
||||||
|
size = None
|
||||||
try:
|
try:
|
||||||
if isinstance(self._driver, _HttpDriver) and obj:
|
if isinstance(self._driver, _HttpDriver) and obj:
|
||||||
obj = self._driver._get_download_object(obj) # noqa
|
obj = self._driver._get_download_object(obj) # noqa
|
||||||
@ -1556,6 +1557,7 @@ class _Boto3Driver(_Driver):
|
|||||||
@attrs
|
@attrs
|
||||||
class ListResult(object):
|
class ListResult(object):
|
||||||
name = attrib(default=None)
|
name = attrib(default=None)
|
||||||
|
size = attrib(default=None)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
@ -1617,7 +1619,7 @@ class _Boto3Driver(_Driver):
|
|||||||
else:
|
else:
|
||||||
res = container.bucket.objects.all()
|
res = container.bucket.objects.all()
|
||||||
for res in res:
|
for res in res:
|
||||||
yield self.ListResult(name=res.key)
|
yield self.ListResult(name=res.key, size=res.size)
|
||||||
|
|
||||||
def delete_object(self, object, **kwargs):
|
def delete_object(self, object, **kwargs):
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
|
Loading…
Reference in New Issue
Block a user