diff --git a/swh/vault/api/client.py b/swh/vault/api/client.py --- a/swh/vault/api/client.py +++ b/swh/vault/api/client.py @@ -6,7 +6,7 @@ from swh.model import hashutil from swh.core.api import RPCClient -from swh.vault.backend import NotFoundExc +from swh.vault.exc import NotFoundExc class RemoteVaultClient(RPCClient): diff --git a/swh/vault/backend.py b/swh/vault/backend.py --- a/swh/vault/backend.py +++ b/swh/vault/backend.py @@ -4,16 +4,18 @@ # See top-level LICENSE file for more information import smtplib +from email.mime.text import MIMEText + import psycopg2.extras import psycopg2.pool -from email.mime.text import MIMEText - from swh.core.db import BaseDb from swh.core.db.common import db_transaction from swh.model import hashutil from swh.scheduler.utils import create_oneshot_task_dict + from swh.vault.cookers import get_cooker_cls +from swh.vault.exc import NotFoundExc cooking_task_name = "swh.vault.cooking_tasks.SWHCookingTask" @@ -57,12 +59,6 @@ """ -class NotFoundExc(Exception): - """Bundle was not found.""" - - pass - - def batch_to_bytes(batch): return [(obj_type, hashutil.hash_to_bytes(obj_id)) for obj_type, obj_id in batch] diff --git a/swh/vault/exc.py b/swh/vault/exc.py new file mode 100644 --- /dev/null +++ b/swh/vault/exc.py @@ -0,0 +1,8 @@ +# Copyright (C) 2020 The Software Heritage developers +# See the AUTHORS file at the top-level directory of this distribution +# License: GNU General Public License version 3, or any later version +# See top-level LICENSE file for more information + + +class NotFoundExc(Exception): + pass