From: Brian Warner Date: Mon, 17 Sep 2007 08:44:39 +0000 (-0700) Subject: debug: remove the 'dump-share-leases' command, it is subsumed by 'dump-share' X-Git-Tag: allmydata-tahoe-0.6.0~83 X-Git-Url: https://git.rkrishnan.org/somewhere?a=commitdiff_plain;h=6cd11037c6f46f5ca9d496c1ae592cac7a4969fd;p=tahoe-lafs%2Ftahoe-lafs.git debug: remove the 'dump-share-leases' command, it is subsumed by 'dump-share' --- diff --git a/src/allmydata/scripts/debug.py b/src/allmydata/scripts/debug.py index 190f14c0..15b810c1 100644 --- a/src/allmydata/scripts/debug.py +++ b/src/allmydata/scripts/debug.py @@ -110,29 +110,6 @@ def dump_share(config, out=sys.stdout, err=sys.stderr): print >>out return 0 -def dump_share_leases(config, out=sys.stdout, err=sys.stderr): - from allmydata import storage - - f = storage.ShareFile(config['filename']) - now = time.time() - leases = list(f.iter_leases()) - if leases: - for i,lease in enumerate(leases): - (owner_num, renew_secret, cancel_secret, expiration_time) = lease - remains = expiration_time - now - when = "%ds" % remains - if remains > 24*3600: - when += " (%d days)" % (remains / (24*3600)) - elif remains > 3600: - when += " (%d hours)" % (remains / 3600) - print >>out, "Lease #%d: owner=%d, expire in %s" % (i, owner_num, - when) - else: - print >>out, "No leases." - - print >>out - return 0 - def dump_root_dirnode(config, out=sys.stdout, err=sys.stderr): from allmydata import uri @@ -211,8 +188,6 @@ def dump_directory_node(config, out=sys.stdout, err=sys.stderr): subCommands = [ ["dump-share", None, DumpOptions, "Unpack and display the contents of a share (uri_extension and leases)."], - ["dump-share-leases", None, DumpOptions, - "Unpack and display the leases for a given share."], ["dump-root-dirnode", None, DumpRootDirnodeOptions, "Compute most of the URI for the vdrive server's root dirnode."], ["dump-dirnode", None, DumpDirnodeOptions, @@ -221,7 +196,6 @@ subCommands = [ dispatch = { "dump-share": dump_share, - "dump-share-leases": dump_share_leases, "dump-root-dirnode": dump_root_dirnode, "dump-dirnode": dump_directory_node, }