class DumpOptions(BaseOptions):
def getSynopsis(self):
- return "Usage: tahoe [global-opts] debug dump-share SHARE_FILENAME"
+ return "Usage: tahoe [global-options] debug dump-share SHARE_FILENAME"
optFlags = [
["offsets", None, "Display a table of section offsets."],
["leases-only", None, "Dump leases but not CHK contents."],
]
- def getUsage(self, width=None):
- t = BaseOptions.getUsage(self, width)
- t += """
+ description = """
Print lots of information about the given share, by parsing the share's
contents. This includes share type, lease information, encoding parameters,
hash-tree roots, public keys, and segment sizes. This command also emits a
verify-cap for the file that uses the share.
tahoe debug dump-share testgrid/node-3/storage/shares/4v/4vozh77tsrw7mdhnj7qvp5ky74/0
-
"""
- return t
def parseArgs(self, filename):
from allmydata.util.encodingutil import argv_to_abspath
class DumpCapOptions(BaseOptions):
def getSynopsis(self):
- return "Usage: tahoe [global-opts] debug dump-cap [options] FILECAP"
+ return "Usage: tahoe [global-options] debug dump-cap [options] FILECAP"
optParameters = [
["nodeid", "n",
None, "Specify the storage server nodeid (ASCII), to construct WE and secrets."],
def parseArgs(self, cap):
self.cap = cap
- def getUsage(self, width=None):
- t = BaseOptions.getUsage(self, width)
- t += """
+ description = """
Print information about the given cap-string (aka: URI, file-cap, dir-cap,
read-cap, write-cap). The URI string is parsed and unpacked. This prints the
type of the cap, its storage index, and any derived keys.
base secret), this command will compute the shared secrets used for the
write-enabler and for lease-renewal.
"""
- return t
def dump_cap(options):
class FindSharesOptions(BaseOptions):
def getSynopsis(self):
- return "Usage: tahoe [global-opts] debug find-shares STORAGE_INDEX NODEDIRS.."
+ return "Usage: tahoe [global-options] debug find-shares STORAGE_INDEX NODEDIRS.."
def parseArgs(self, storage_index_s, *nodedirs):
from allmydata.util.encodingutil import argv_to_abspath
self.si_s = storage_index_s
self.nodedirs = map(argv_to_abspath, nodedirs)
- def getUsage(self, width=None):
- t = BaseOptions.getUsage(self, width)
- t += """
+ description = """
Locate all shares for the given storage index. This command looks through one
or more node directories to find the shares. It returns a list of filenames,
one per line, for each share file found.
nodes are on a local disk. The share files thus located can be counted,
examined (with dump-share), or corrupted/deleted to test checker/repairer.
"""
- return t
def find_shares(options):
"""Given a storage index and a list of node directories, emit a list of
class CatalogSharesOptions(BaseOptions):
- """
-
- """
def parseArgs(self, *nodedirs):
from allmydata.util.encodingutil import argv_to_abspath
self.nodedirs = map(argv_to_abspath, nodedirs)
raise usage.UsageError("must specify at least one node directory")
def getSynopsis(self):
- return "Usage: tahoe [global-opts] debug catalog-shares NODEDIRS.."
+ return "Usage: tahoe [global-options] debug catalog-shares NODEDIRS.."
- def getUsage(self, width=None):
- t = BaseOptions.getUsage(self, width)
- t += """
+ description = """
Locate all shares in the given node directories, and emit a one-line summary
of each share. Run it like this:
then something is wrong. The misc/find-share/anomalies.py script may be
useful for purpose.
"""
- return t
def call(c, *args, **kwargs):
# take advantage of the fact that ImmediateReadBucketProxy returns
class CorruptShareOptions(BaseOptions):
def getSynopsis(self):
- return "Usage: tahoe [global-opts] debug corrupt-share SHARE_FILENAME"
+ return "Usage: tahoe [global-options] debug corrupt-share SHARE_FILENAME"
optParameters = [
["offset", "o", "block-random", "Specify which bit to flip."],
]
- def getUsage(self, width=None):
- t = BaseOptions.getUsage(self, width)
- t += """
+ description = """
Corrupt the given share by flipping a bit. This will cause a
verifying/downloading client to log an integrity-check failure incident, and
downloads will proceed with a different share.
Obviously, this command should not be used in normal operation.
"""
- return t
def parseArgs(self, filename):
self['filename'] = filename
class ReplOptions(BaseOptions):
def getSynopsis(self):
- return "Usage: tahoe [global-opts] debug repl"
+ return "Usage: tahoe [global-options] debug repl"
def repl(options):
import code
class TrialOptions(twisted_trial.Options):
def getSynopsis(self):
- return "Usage: tahoe [global-opts] debug trial [options] [[file|package|module|TestCase|testmethod]...]"
+ return "Usage: tahoe [global-options] debug trial [options] [[file|package|module|TestCase|testmethod]...]"
def parseOptions(self, all_subargs, *a, **kw):
self.trial_args = list(all_subargs)
if not nonoption_args:
self.trial_args.append(DEFAULT_TESTSUITE)
- def getUsage(self, width=None):
- t = twisted_trial.Options.getUsage(self, width)
- t += """
-The 'tahoe debug trial' command uses the correct imports for this instance of
-Tahoe-LAFS. The default test suite is '%s'.
-""" % (DEFAULT_TESTSUITE,)
- return t
+ longdesc = twisted_trial.Options.longdesc + "\n\n" + (
+ "The 'tahoe debug trial' command uses the correct imports for this "
+ "instance of Tahoe-LAFS. The default test suite is '%s'."
+ % DEFAULT_TESTSUITE)
def trial(config):
sys.argv = ['trial'] + config.trial_args
t = OptionsClass.getSynopsis(self)
i = t.find("Usage: flogtool ")
if i >= 0:
- return "Usage: tahoe [global-opts] debug flogtool " + t[i+len("Usage: flogtool "):]
+ return "Usage: tahoe [global-options] debug flogtool " + t[i+len("Usage: flogtool "):]
else:
- return "Usage: tahoe [global-opts] debug flogtool %s [options]" % (subcmd,)
+ return "Usage: tahoe [global-options] debug flogtool %s [options]" % (subcmd,)
return (subcmd, shortcut, FixedOptionsClass, desc)
class FlogtoolOptions(foolscap_cli.Options):
self.subCommands = map(fixOptionsClass, self.subCommands)
def getSynopsis(self):
- return "Usage: tahoe [global-opts] debug flogtool (%s) [command options]" % ("|".join([x[0] for x in self.subCommands]))
+ return "Usage: tahoe [global-options] debug flogtool COMMAND [flogtool-options]"
def parseOptions(self, all_subargs, *a, **kw):
self.flogtool_args = list(all_subargs)
The 'tahoe debug flogtool' command uses the correct imports for this instance
of Tahoe-LAFS.
-Please run 'tahoe debug flogtool SUBCOMMAND --help' for more details on each
+Please run 'tahoe debug flogtool COMMAND --help' for more details on each
subcommand.
"""
return t
def postOptions(self):
if not hasattr(self, 'subOptions'):
raise usage.UsageError("must specify a subcommand")
- def getSynopsis(self):
- return ""
+ synopsis = "COMMAND"
+
def getUsage(self, width=None):
- #t = BaseOptions.getUsage(self, width)
- t = """Usage: tahoe debug SUBCOMMAND
-Subcommands:
- tahoe debug dump-share Unpack and display the contents of a share.
- tahoe debug dump-cap Unpack a read-cap or write-cap.
- tahoe debug find-shares Locate sharefiles in node directories.
- tahoe debug catalog-shares Describe all shares in node dirs.
- tahoe debug corrupt-share Corrupt a share by flipping a bit.
- tahoe debug repl Open a Python interpreter.
- tahoe debug trial Run tests using Twisted Trial with the right imports.
- tahoe debug flogtool Utilities to access log files.
+ t = BaseOptions.getUsage(self, width)
+ t += """\
Please run e.g. 'tahoe debug dump-share --help' for more details on each
subcommand.