Example #1
0
 def list_versions(self) -> Iterable[VersionUid]:
     keys = self._list_objects(VersionUid.storage_prefix())
     for key in keys:
         assert isinstance(key, str)
         if key.endswith(self._META_SUFFIX):
             continue
         try:
             yield cast(VersionUid, VersionUid.storage_path_to_object(key))
         except (RuntimeError, ValueError):
             # Ignore any keys which don't match our pattern to account for stray objects/files
             pass
Example #2
0
 def list_versions(self) -> List[VersionUid]:
     keys = self._list_objects(VersionUid.storage_prefix())
     version_uids: List[VersionUid] = []
     for key in keys:
         if key.endswith(self._META_SUFFIX):
             continue
         try:
             version_uids.append(
                 cast(VersionUid, VersionUid.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 version_uids