]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
scripts/debug: split out dump_immutable_share
authorBrian Warner <warner@allmydata.com>
Tue, 12 Aug 2008 20:55:17 +0000 (13:55 -0700)
committerBrian Warner <warner@allmydata.com>
Tue, 12 Aug 2008 20:55:17 +0000 (13:55 -0700)
src/allmydata/scripts/debug.py

index 97921f3998f477d0ed6d7c07f1a897c41cd606ad..a32c67c3d6ffb2d88750c9ad920bf2e8838de858 100644 (file)
@@ -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)