Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9696580
D7905.id28504.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D7905.id28504.diff
View Options
diff --git a/swh/scrubber/__init__.py b/swh/scrubber/__init__.py
--- a/swh/scrubber/__init__.py
+++ b/swh/scrubber/__init__.py
@@ -12,8 +12,10 @@
def get_scrubber_db(cls: str, **kwargs) -> ScrubberDb:
- if cls != "local":
- raise ValueError(f"Unknown scrubber db class '{cls}', use 'local' instead.")
+ if cls not in ("local", "postgresql"):
+ raise ValueError(
+ f"Unknown scrubber db class '{cls}', use 'postgresql' instead."
+ )
from .db import ScrubberDb
diff --git a/swh/scrubber/tests/test_cli.py b/swh/scrubber/tests/test_cli.py
--- a/swh/scrubber/tests/test_cli.py
+++ b/swh/scrubber/tests/test_cli.py
@@ -25,7 +25,7 @@
runner = CliRunner()
config = {
- "scrubber_db": {"cls": "local", "db": scrubber_db.conn.dsn},
+ "scrubber_db": {"cls": "postgresql", "db": scrubber_db.conn.dsn},
"graph": {"url": "http://graph.example.org:5009/"},
}
if storage:
@@ -72,7 +72,7 @@
assert result.exit_code == 0, result.output
assert result.output == ""
- get_scrubber_db.assert_called_once_with(cls="local", db=scrubber_db.conn.dsn)
+ get_scrubber_db.assert_called_once_with(cls="postgresql", db=scrubber_db.conn.dsn)
StorageChecker.assert_called_once_with(
db=scrubber_db,
storage=StorageChecker.mock_calls[0][2]["storage"],
@@ -103,7 +103,7 @@
assert result.exit_code == 0, result.output
assert result.output == ""
- get_scrubber_db.assert_called_once_with(cls="local", db=scrubber_db.conn.dsn)
+ get_scrubber_db.assert_called_once_with(cls="postgresql", db=scrubber_db.conn.dsn)
JournalChecker.assert_called_once_with(
db=scrubber_db,
journal_client={
@@ -129,7 +129,7 @@
assert result.exit_code == 0, result.output
assert result.output == ""
- get_scrubber_db.assert_called_once_with(cls="local", db=scrubber_db.conn.dsn)
+ get_scrubber_db.assert_called_once_with(cls="postgresql", db=scrubber_db.conn.dsn)
OriginLocator.assert_called_once_with(
db=scrubber_db,
storage=OriginLocator.mock_calls[0][2]["storage"],
@@ -150,7 +150,7 @@
assert result.exit_code == 0, result.output
assert result.output == ""
- get_scrubber_db.assert_called_once_with(cls="local", db=scrubber_db.conn.dsn)
+ get_scrubber_db.assert_called_once_with(cls="postgresql", db=scrubber_db.conn.dsn)
Fixer.assert_called_once_with(
db=scrubber_db,
start_object=CoreSWHID.from_string("swh:1:cnt:" + "00" * 20),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 17, 8:45 PM (2 h, 20 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3217886
Attached To
D7905: Unify factory to use keyword 'postgresql' over deprecated 'local'
Event Timeline
Log In to Comment