]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
runner: make most commands use ~/.tahoe by default (create-client, start/stop/restart...
authorBrian Warner <warner@lothar.com>
Thu, 11 Oct 2007 08:54:23 +0000 (01:54 -0700)
committerBrian Warner <warner@lothar.com>
Thu, 11 Oct 2007 08:54:23 +0000 (01:54 -0700)
src/allmydata/scripts/common.py
src/allmydata/scripts/create_node.py
src/allmydata/test/test_runner.py

index f51e886a4455f40ac95afd92e539c2c4e73a091f..64cceb88e57cab62312766dc066584e0a3f7bb7a 100644 (file)
@@ -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'])
index 5eb1b092e7ddea44f2669396f1c403a7b4d28027..76263e207801626884516df3943017ac42ea88b5 100644 (file)
@@ -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"],
         ]
index 57a10f81dcd5b79937c9ddf9f7030deeae69ca9f..4faa321ffcb05394b6d12bd429e7591498512676 100644 (file)
@@ -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")