mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 02:01:31 +00:00
rename "my_private_dir.uri" to "my_private_dir.cap"
This commit is contained in:
parent
08a64c3a2b
commit
a983f6d60c
@ -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()
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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/")
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user