Page MenuHomeSoftware Heritage

D6524.id23720.diff
No OneTemporary

D6524.id23720.diff

diff --git a/swh/objstorage/factory.py b/swh/objstorage/factory.py
--- a/swh/objstorage/factory.py
+++ b/swh/objstorage/factory.py
@@ -22,11 +22,12 @@
"pathslicing": PathSlicingObjStorage,
"remote": RemoteObjStorage,
"memory": InMemoryObjStorage,
- "weed": WeedObjStorage,
+ "seaweedfs": WeedObjStorage,
"random": RandomGeneratorObjStorage,
}
_STORAGE_CLASSES_MISSING = {}
+_STORAGE_CLASSES_DEPRECATED = {"weed": "seaweedfs"}
try:
from swh.objstorage.backends.azure import (
@@ -75,6 +76,13 @@
ValueError: if the given storage class is not a valid objstorage
key.
"""
+ if cls in _STORAGE_CLASSES_DEPRECATED:
+ warnings.warn(
+ f"{cls} objstorage class is deprecated, "
+ f"use {_STORAGE_CLASSES_DEPRECATED[cls]} class instead.",
+ DeprecationWarning,
+ )
+ cls = _STORAGE_CLASSES_DEPRECATED[cls]
if cls in _STORAGE_CLASSES:
if args is not None:
warnings.warn(
@@ -85,7 +93,6 @@
# TODO: when removing this, drop the "args" backwards compatibility
# from swh.objstorage.api.server configuration checker
kwargs = args
-
return _STORAGE_CLASSES[cls](**kwargs)
else:
raise ValueError(

File Metadata

Mime Type
text/plain
Expires
Jul 3 2025, 6:09 PM (4 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3217200

Event Timeline