Пример #1
0
 def list_blocks(self) -> Iterable[BlockUid]:
     keys = self._list_objects(BlockUid.storage_prefix())
     for key in keys:
         assert isinstance(key, str)
         if key.endswith(self._META_SUFFIX):
             continue
         try:
             yield cast(BlockUid, BlockUid.storage_path_to_object(key))
         except (RuntimeError, ValueError):
             # Ignore any keys which don't match our pattern to account for stray objects/files
             pass
Пример #2
0
 def list_blocks(self) -> List[BlockUid]:
     keys = self._list_objects(BlockUid.storage_prefix())
     block_uids: List[BlockUid] = []
     for key in keys:
         if key.endswith(self._META_SUFFIX):
             continue
         try:
             block_uids.append(
                 cast(BlockUid, BlockUid.storage_path_to_object(key)))
         except (RuntimeError, ValueError):
             # Ignore any keys which don't match our pattern to account for stray objects/files
             pass
     return block_uids