mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-23 01:08:53 +00:00
dirnode manifest: add verifycaps, both to internal API and to webapi. This will give the manual-GC tools more to work with, so they can estimate how much space will be freed.
This commit is contained in:
@ -641,17 +641,22 @@ class ManifestWalker(DeepStats):
|
||||
DeepStats.__init__(self, origin)
|
||||
self.manifest = []
|
||||
self.storage_index_strings = set()
|
||||
self.verifycaps = set()
|
||||
|
||||
def add_node(self, node, path):
|
||||
self.manifest.append( (tuple(path), node.get_uri()) )
|
||||
si = node.get_storage_index()
|
||||
if si:
|
||||
self.storage_index_strings.add(base32.b2a(si))
|
||||
v = node.get_verifier()
|
||||
if v:
|
||||
self.verifycaps.add(v.to_string())
|
||||
return DeepStats.add_node(self, node, path)
|
||||
|
||||
def get_results(self):
|
||||
stats = DeepStats.get_results(self)
|
||||
return {"manifest": self.manifest,
|
||||
"verifycaps": self.verifycaps,
|
||||
"storage-index": self.storage_index_strings,
|
||||
"stats": stats,
|
||||
}
|
||||
|
Reference in New Issue
Block a user