scripts/debug: split out dump_immutable_share

This commit is contained in:
Brian Warner 2008-08-12 13:55:17 -07:00
parent 533afd039f
commit acb0297806

View File

@ -25,8 +25,7 @@ verify-cap for the file that uses the share.
self['filename'] = filename self['filename'] = filename
def dump_share(options): def dump_share(options):
from allmydata import uri, storage from allmydata import storage
from allmydata.util import base32
out = options.stdout out = options.stdout
@ -39,6 +38,13 @@ def dump_share(options):
if prefix == storage.MutableShareFile.MAGIC: if prefix == storage.MutableShareFile.MAGIC:
return dump_mutable_share(options) return dump_mutable_share(options)
# otherwise assume it's immutable # 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']) f = storage.ShareFile(options['filename'])
# use a ReadBucketProxy to parse the bucket and find the uri extension # use a ReadBucketProxy to parse the bucket and find the uri extension
bp = storage.ReadBucketProxy(None) bp = storage.ReadBucketProxy(None)