diff --git a/swh/objstorage/multiplexer/filter/read_write_filter.py b/swh/objstorage/multiplexer/filter/read_write_filter.py index f49f9c2..1536815 100644 --- a/swh/objstorage/multiplexer/filter/read_write_filter.py +++ b/swh/objstorage/multiplexer/filter/read_write_filter.py @@ -1,21 +1,24 @@ # Copyright (C) 2015-2016 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 from .filter import ObjStorageFilter class ReadObjStorageFilter(ObjStorageFilter): """ Filter that disable write operation of the storage. Writes will always succeed without doing any actual write operations. """ def check_config(self, *, check_write): return self.storage.check_config(check_write=False) def add(self, *args, **kwargs): return def restore(self, *args, **kwargs): return + + def delete(self, *args, **kwargs): + return True diff --git a/swh/objstorage/multiplexer/filter/resilient_filter.py b/swh/objstorage/multiplexer/filter/resilient_filter.py new file mode 100644 index 0000000..3ac422c --- /dev/null +++ b/swh/objstorage/multiplexer/filter/resilient_filter.py @@ -0,0 +1,15 @@ +# Copyright (C) 2017 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 + +from .filter import ObjStorageFilter + + +class ResilientStorageFilter(ObjStorageFilter): + """ Filter that disable delete operation of the storage. + + Deletes will always succeed without doing any actual write operations. + """ + def delete(self, *args, **kwargs): + return