Revision 746e0495b0c74a7fab1b5274654668d26a8da744 authored by Quentin Campos on 14 June 2016, 15:01:40 UTC, committed by Quentin Campos on 16 June 2016, 12:47:50 UTC
Example, for "abcdef1234567890" with slicing "0:2/0:5", path will be "root/ab/abcde/". Also, update pathslicing objstorage tests to follow those changes
1 parent 252e49b
swh-objstorage-fsck
#!/usr/bin/python3
# Copyright (C) 2015 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
import logging
import sys
from swh.storage import objstorage
if __name__ == '__main__':
try:
root_dir = sys.argv[1]
except IndexError:
print("Usage: swh-objstorage-add-dir OBJ_STORAGE_DIR")
sys.exit(1)
logging.basicConfig(level=logging.INFO)
objs = objstorage.ObjStorage(root_dir)
for obj_id in objs:
try:
objs.check(obj_id)
except objstorage.Error as err:
logging.error(err)
Computing file changes ...