Change code that gives a base32 SI or an empty string to be more straightforward. (#948)

This commit is contained in:
david-sarah 2010-02-26 22:55:51 -08:00
parent a2ed17f2a0
commit 40edf8f419
2 changed files with 10 additions and 2 deletions

View File

@ -830,9 +830,13 @@ class ManifestWalker(DeepStats):
class DeepChecker: class DeepChecker:
def __init__(self, root, verify, repair, add_lease): def __init__(self, root, verify, repair, add_lease):
root_si = root.get_storage_index() root_si = root.get_storage_index()
if root_si:
root_si_base32 = base32.b2a(root_si)
else:
root_si_base32 = ""
self._lp = log.msg(format="deep-check starting (%(si)s)," self._lp = log.msg(format="deep-check starting (%(si)s),"
" verify=%(verify)s, repair=%(repair)s", " verify=%(verify)s, repair=%(repair)s",
si=base32.b2a(root_si or ""), verify=verify, repair=repair) si=root_si_base32, verify=verify, repair=repair)
self._verify = verify self._verify = verify
self._repair = repair self._repair = repair
self._add_lease = add_lease self._add_lease = add_lease

View File

@ -923,9 +923,13 @@ class ManifestResults(rend.Page, ReloadMixin):
m = self.monitor m = self.monitor
s = m.get_status() s = m.get_status()
if m.origin_si:
origin_base32 = base32.b2a(m.origin_si)
else:
origin_base32 = ""
status = { "stats": s["stats"], status = { "stats": s["stats"],
"finished": m.is_finished(), "finished": m.is_finished(),
"origin": base32.b2a(m.origin_si or ""), "origin": origin_base32,
} }
if m.is_finished(): if m.is_finished():
# don't return manifest/verifycaps/SIs unless the operation is # don't return manifest/verifycaps/SIs unless the operation is