From: Brian Warner Date: Tue, 12 Aug 2008 20:55:17 +0000 (-0700) Subject: scripts/debug: split out dump_immutable_share X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/index.php?a=commitdiff_plain;h=acb0297806cf5ef17fe20ebd85decd01860c471c;p=tahoe-lafs%2Ftahoe-lafs.git scripts/debug: split out dump_immutable_share --- diff --git a/src/allmydata/scripts/debug.py b/src/allmydata/scripts/debug.py index 97921f39..a32c67c3 100644 --- a/src/allmydata/scripts/debug.py +++ b/src/allmydata/scripts/debug.py @@ -25,8 +25,7 @@ verify-cap for the file that uses the share. self['filename'] = filename def dump_share(options): - from allmydata import uri, storage - from allmydata.util import base32 + from allmydata import storage out = options.stdout @@ -39,6 +38,13 @@ def dump_share(options): if prefix == storage.MutableShareFile.MAGIC: return dump_mutable_share(options) # otherwise assume it's immutable + return dump_immutable_share(options) + +def dump_immutable_share(options): + from allmydata import uri, storage + from allmydata.util import base32 + + out = options.stdout f = storage.ShareFile(options['filename']) # use a ReadBucketProxy to parse the bucket and find the uri extension bp = storage.ReadBucketProxy(None)