From: Brian Warner Date: Thu, 11 Oct 2007 08:54:23 +0000 (-0700) Subject: runner: make most commands use ~/.tahoe by default (create-client, start/stop/restart... X-Git-Tag: allmydata-tahoe-0.6.1~48 X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/file/URI:LIT:krugkidfnzsc4/%3C?a=commitdiff_plain;h=7fd1964c6f87d0ab9c8645244364ebad9d834f89;p=tahoe-lafs%2Ftahoe-lafs.git runner: make most commands use ~/.tahoe by default (create-client, start/stop/restart, all CLI tools, but *not* create-introducer --- diff --git a/src/allmydata/scripts/common.py b/src/allmydata/scripts/common.py index f51e886a..64cceb88 100644 --- a/src/allmydata/scripts/common.py +++ b/src/allmydata/scripts/common.py @@ -40,7 +40,7 @@ class BasedirMixin: self.basedirs.extend(args) else: if len(args) == 0 and not self.basedirs: - self.basedirs.append(".") + self.basedirs.append(os.path.expanduser("~/.tahoe")) if len(args) > 0: self.basedirs.append(args[0]) if len(args) > 1: @@ -48,7 +48,7 @@ class BasedirMixin: class NoDefaultBasedirMixin(BasedirMixin): def parseArgs(self, *args): - # create-client won't default to --basedir=. + # create-client won't default to --basedir=~/.tahoe self.basedirs = [] if self['basedir']: self.basedirs.append(self['basedir']) diff --git a/src/allmydata/scripts/create_node.py b/src/allmydata/scripts/create_node.py index 5eb1b092..76263e20 100644 --- a/src/allmydata/scripts/create_node.py +++ b/src/allmydata/scripts/create_node.py @@ -1,9 +1,9 @@ import os, sys from twisted.python import usage -from allmydata.scripts.common import NoDefaultBasedirMixin +from allmydata.scripts.common import BasedirMixin, NoDefaultBasedirMixin -class CreateClientOptions(NoDefaultBasedirMixin, usage.Options): +class CreateClientOptions(BasedirMixin, usage.Options): optParameters = [ ["basedir", "C", None, "which directory to create the client in"], ] diff --git a/src/allmydata/test/test_runner.py b/src/allmydata/test/test_runner.py index 57a10f81..4faa321f 100644 --- a/src/allmydata/test/test_runner.py +++ b/src/allmydata/test/test_runner.py @@ -44,11 +44,6 @@ class CreateNode(unittest.TestCase): ["create-client", "basedir", "extraarg"], run_by_human=False) - self.failUnlessRaises(usage.UsageError, - runner.runner, - ["create-client"], - run_by_human=False) - def test_introducer(self): basedir = self.workdir("test_introducer") c1 = os.path.join(basedir, "c1")