From: Zooko O'Whielacronx Date: Tue, 18 Dec 2007 01:35:25 +0000 (-0700) Subject: rename "my_private_dir.uri" to "my_private_dir.cap" X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/%22doc.html/something?a=commitdiff_plain;h=a983f6d60c49d71bdc12b179294455eb5681860b;p=tahoe-lafs%2Ftahoe-lafs.git rename "my_private_dir.uri" to "my_private_dir.cap" --- diff --git a/src/allmydata/client.py b/src/allmydata/client.py index 7bf9bf3f..41be23de 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -30,7 +30,7 @@ class Client(node.Node, Referenceable, testutil.PollMixin): STOREDIR = 'storage' NODETYPE = "client" SUICIDE_PREVENTION_HOTLINE_FILE = "suicide_prevention_hotline" - PRIVATE_DIRECTORY_URI = "my_private_dir.uri" + MY_PRIVATE_DIR_FILE = "my_private_dir.cap" # we're pretty narrow-minded right now OLDEST_SUPPORTED_VERSION = allmydata.__version__ @@ -115,12 +115,12 @@ class Client(node.Node, Referenceable, testutil.PollMixin): def _maybe_create_private_directory(self): """ - If 'my_private_dir.uri' exists, then I try to read a mutable + If 'my_private_dir.cap' exists, then I try to read a mutable directory URI from it. If it exists but doesn't contain a well-formed read-write mutable directory URI, then I create a new mutable directory and write its URI into that file. """ - privdirfile = os.path.join(self.basedir, self.PRIVATE_DIRECTORY_URI) + privdirfile = os.path.join(self.basedir, self.MY_PRIVATE_DIR_FILE) if os.path.exists(privdirfile): try: theuri = open(privdirfile, "r").read().strip() diff --git a/src/allmydata/scripts/cli.py b/src/allmydata/scripts/cli.py index 6d03b758..b14f08be 100644 --- a/src/allmydata/scripts/cli.py +++ b/src/allmydata/scripts/cli.py @@ -11,7 +11,7 @@ class VDriveOptions(BaseOptions, usage.Options): "Look here to find out which Tahoe node should be used for all " "operations. The directory should either contain a full Tahoe node, " "or a file named node.url which points to some other Tahoe node. " - "It should also contain a file named my_private_dir.uri which contains " + "It should also contain a file named my_private_dir.cap which contains " "the root dirnode URI that should be used." ], ["node-url", "u", None, @@ -20,7 +20,7 @@ class VDriveOptions(BaseOptions, usage.Options): ["root-uri", "r", "private", "Which dirnode URI should be used as a root directory. The " "string 'private' is also, and means we should use the " - "private vdrive as found in the my_private_dir.uri file in the " + "private vdrive as found in the my_private_dir.cap file in the " "--node-directory ."], ] @@ -41,7 +41,7 @@ class VDriveOptions(BaseOptions, usage.Options): # also compute self['root-uri'] if self['root-uri'] == "private": - uri_file = os.path.join(self['node-directory'], "my_private_dir.uri") + uri_file = os.path.join(self['node-directory'], "my_private_dir.cap") self['root-uri'] = open(uri_file, "r").read().strip() else: from allmydata import uri diff --git a/src/allmydata/scripts/create_node.py b/src/allmydata/scripts/create_node.py index 7423925d..541041f0 100644 --- a/src/allmydata/scripts/create_node.py +++ b/src/allmydata/scripts/create_node.py @@ -56,9 +56,9 @@ def create_client(basedir, config, out=sys.stdout, err=sys.stderr): f = open(os.path.join(basedir, "webport"), "w") f.write(config['webport'] + "\n") f.close() - # Create an empty my_private_dir.uri file, indicating that the node + # Create an empty my_private_dir.cap file, indicating that the node # should fill it with the URI after creating the directory. - open(os.path.join(basedir, "my_private_dir.uri"), "w") + open(os.path.join(basedir, "my_private_dir.cap"), "w") print >>out, "client created in %s" % basedir print >>out, " please copy introducer.furl into the directory" diff --git a/src/allmydata/test/test_cli.py b/src/allmydata/test/test_cli.py index 71550fa9..1b4375ef 100644 --- a/src/allmydata/test/test_cli.py +++ b/src/allmydata/test/test_cli.py @@ -20,7 +20,7 @@ class CLI(unittest.TestCase): filenode_uri = uri.WriteableSSKFileURI(writekey="\x00"*16, fingerprint="\x00"*32) private_uri = uri.NewDirectoryURI(filenode_uri).to_string() - open("cli/test_options/my_private_dir.uri", "w").write(private_uri + "\n") + open("cli/test_options/my_private_dir.cap", "w").write(private_uri + "\n") o = cli.ListOptions() o.parseOptions(["--node-directory", "cli/test_options"]) self.failUnlessEqual(o['node-url'], "http://localhost:8080/") diff --git a/src/allmydata/test/test_system.py b/src/allmydata/test/test_system.py index e9e7ad50..ea928108 100644 --- a/src/allmydata/test/test_system.py +++ b/src/allmydata/test/test_system.py @@ -70,7 +70,7 @@ class SystemTest(testutil.SignalMixin, unittest.TestCase): if i == 0: open(os.path.join(basedir, "webport"), "w").write("tcp:0:interface=127.0.0.1") if self.createprivdir: - open(os.path.join(basedir, "my_private_dir.uri"), "w") + open(os.path.join(basedir, "my_private_dir.cap"), "w") open(os.path.join(basedir, "introducer.furl"), "w").write(self.introducer_furl) c = self.add_service(client.Client(basedir=basedir)) self.clients.append(c)