From: Brian Warner Date: Wed, 7 Nov 2007 02:31:22 +0000 (-0700) Subject: add container_size to mutable dump-share output X-Git-Url: https://git.rkrishnan.org/module-simplejson.encoder.html?a=commitdiff_plain;h=fdbe6928109ab6e4bc7819c4f317b473faedf667;p=tahoe-lafs%2Ftahoe-lafs.git add container_size to mutable dump-share output --- diff --git a/src/allmydata/scripts/debug.py b/src/allmydata/scripts/debug.py index d899b10c..92ea94b8 100644 --- a/src/allmydata/scripts/debug.py +++ b/src/allmydata/scripts/debug.py @@ -135,6 +135,7 @@ def dump_mutable_share(config, out, err): num_extra_leases = m._read_num_extra_leases(f) data_length = m._read_data_length(f) extra_lease_offset = m._read_extra_lease_offset(f) + container_size = extra_lease_offset - m.DATA_OFFSET leases = list(m._enumerate_leases(f)) f.close() @@ -143,9 +144,11 @@ def dump_mutable_share(config, out, err): print >>out, " write_enabler: %s" % idlib.b2a(WE) print >>out, " WE for nodeid: %s" % idlib.nodeid_b2a(nodeid) print >>out, " num_extra_leases: %d" % num_extra_leases + print >>out, " container_size: %d" % container_size print >>out, " data_length: %d" % data_length if leases: for (leasenum, (oid,et,rs,cs,anid)) in leases: + print >>out print >>out, " Lease #%d:" % leasenum print >>out, " ownerid: %d" % oid when = format_expiration_time(et) diff --git a/src/allmydata/test/test_system.py b/src/allmydata/test/test_system.py index 5c3be823..384dc3ce 100644 --- a/src/allmydata/test/test_system.py +++ b/src/allmydata/test/test_system.py @@ -290,6 +290,7 @@ class SystemTest(testutil.SignalMixin, unittest.TestCase): peerid = idlib.nodeid_b2a(self.clients[client_num].nodeid) self.failUnless(" WE for nodeid: %s\n" % peerid in output) self.failUnless(" num_extra_leases: 0\n" in output) + self.failUnless(" container_size: 381\n" in output) self.failUnless(" data_length: 381\n" in output) self.failUnless(" secrets are for nodeid: %s\n" % peerid in output) d.addCallback(_test_debug)