Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9348045
D6524.id23720.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D6524.id23720.diff
View Options
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
Details
Attached
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
Attached To
D6524: Add support for deprecation of objstorage cls in factory
Event Timeline
Log In to Comment