summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-09-27 21:07:57 +0300
committerLars Wirzenius <liw@liw.fi>2015-09-27 21:07:57 +0300
commit675fc3d404db34f4e2bbe886d58ea36d1d940bb8 (patch)
tree4390e9edbc8c45cb2aff289bd69c565757ce35bc
parent8a048c1579ba1bccfc10cdd03b5815a82b0095a7 (diff)
downloadlarch-675fc3d404db34f4e2bbe886d58ea36d1d940bb8.tar.gz
Show dropped B-tree keys in hexadecimal
This is less alarming and confusing to people.
-rwxr-xr-xlarch/fsck.py2
-rw-r--r--larch/fsck_tests.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/larch/fsck.py b/larch/fsck.py
index 68b151a..ac235ad 100755
--- a/larch/fsck.py
+++ b/larch/fsck.py
@@ -117,7 +117,7 @@ class CheckIndexNode(WorkItem):
for key in drop_keys:
self.node.remove(key)
self.warning('index node %s: dropped key %s' %
- (self.node.id, key))
+ (self.node.id, key.encode('hex')))
self.put_node(self.node)
diff --git a/larch/fsck_tests.py b/larch/fsck_tests.py
index ccb4058..f169ad2 100644
--- a/larch/fsck_tests.py
+++ b/larch/fsck_tests.py
@@ -141,7 +141,10 @@ class FsckTests(unittest.TestCase):
cin = larch.fsck.CheckIndexNode(Ffsck, index_node_missing_reference )
for work in cin.do():
work.do() # Expect dropped keys path
- self.failUnless('index node %s: dropped key %s' % (id_index_node, mkey) in self.logged_warnings[0], self.logged_warnings[0] )
+ self.failUnless(
+ 'index node %s: dropped key %s' %
+ (id_index_node, mkey.encode('hex')) in self.logged_warnings[0],
+ self.logged_warnings[0] )
# We have a "node %d is missing" error as well:
self.failUnless( 'node %s is missing' % id_node_to_remove in self.logged_errors[0], self.logged_errors[0] )