From: Zooko O'Whielacronx Date: Sun, 1 Aug 2010 16:42:07 +0000 (-0700) Subject: setup: fix a couple instances of hard-coded 'allmydata-tahoe' in the scripts, tighten... X-Git-Tag: trac-4600~2 X-Git-Url: https://git.rkrishnan.org/htmlfontify-example.html?a=commitdiff_plain;h=fd874d66693d8c7a980ad8cd1a2f2d80f7ea6a98;p=tahoe-lafs%2Ftahoe-lafs.git setup: fix a couple instances of hard-coded 'allmydata-tahoe' in the scripts, tighten the tests (as suggested by David-Sarah) --- diff --git a/src/allmydata/scripts/create_node.py b/src/allmydata/scripts/create_node.py index 4e23ac07..65b18a61 100644 --- a/src/allmydata/scripts/create_node.py +++ b/src/allmydata/scripts/create_node.py @@ -2,6 +2,7 @@ import os, sys from twisted.python import usage from allmydata.scripts.common import BasedirMixin, NoDefaultBasedirMixin +import allmydata class CreateClientOptions(BasedirMixin, usage.Options): optParameters = [ @@ -29,7 +30,7 @@ client_tac = """ # -*- python -*- import pkg_resources -pkg_resources.require('allmydata-tahoe') +pkg_resources.require('%s') pkg_resources.require('twisted') from allmydata import client from twisted.application import service @@ -38,13 +39,13 @@ c = client.Client() application = service.Application("allmydata_client") c.setServiceParent(application) -""" +""" % (allmydata.__appname__,) introducer_tac = """ # -*- python -*- import pkg_resources -pkg_resources.require('allmydata-tahoe') +pkg_resources.require('%s') pkg_resources.require('twisted') from allmydata import introducer from twisted.application import service @@ -53,7 +54,7 @@ c = introducer.IntroducerNode() application = service.Application("allmydata_introducer") c.setServiceParent(application) -""" +""" % (allmydata.__appname__,) def write_node_config(c, config): # this is shared between clients and introducers diff --git a/src/allmydata/scripts/runner.py b/src/allmydata/scripts/runner.py index 9db7d05e..f8c0a096 100644 --- a/src/allmydata/scripts/runner.py +++ b/src/allmydata/scripts/runner.py @@ -6,7 +6,8 @@ import pkg_resources pkg_resources.require('twisted') from twisted.python import usage -pkg_resources.require('allmydata-tahoe') +import allmydata +pkg_resources.require(allmydata.__appname__) from allmydata.scripts.common import BaseOptions from allmydata.scripts import debug, create_node, startstop_node, cli, keygen, stats_gatherer diff --git a/src/allmydata/test/test_runner.py b/src/allmydata/test/test_runner.py index 53571a62..346a32ca 100644 --- a/src/allmydata/test/test_runner.py +++ b/src/allmydata/test/test_runner.py @@ -59,7 +59,7 @@ class BinTahoe(common_util.SignalMixin, unittest.TestCase, SkipMixin): def _cb(res): out, err, rc_or_sig = res self.failUnlessEqual(rc_or_sig, 0, res) - self.failUnless(out.startswith(allmydata.__appname__), res) + self.failUnless(out.startswith(allmydata.__appname__+':'), res) self.failIfIn("DeprecationWarning", out, res) self.failUnlessEqual(err, "", res) d.addCallback(_cb)