mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-07 10:56:49 +00:00
Use a constant.
This commit is contained in:
parent
d700163aec
commit
4aeb62b66c
@ -826,7 +826,7 @@ class _Client(node.Node, pollmixin.PollMixin):
|
||||
if hasattr(self.tub.negotiationClass, "add_storage_server"):
|
||||
nurls = self.tub.negotiationClass.add_storage_server(ss, swissnum.encode("ascii"))
|
||||
self.storage_nurls = nurls
|
||||
announcement["anonymous-storage-NURLs"] = [n.to_text() for n in nurls]
|
||||
announcement[storage_client.ANONYMOUS_STORAGE_NURLS] = [n.to_text() for n in nurls]
|
||||
announcement["anonymous-storage-FURL"] = furl
|
||||
|
||||
enabled_storage_servers = self._enable_storage_servers(
|
||||
|
@ -80,6 +80,8 @@ from allmydata.storage.http_client import (
|
||||
ReadVector, TestWriteVectors, WriteVector, TestVector, ClientException
|
||||
)
|
||||
|
||||
ANONYMOUS_STORAGE_NURLS = "anonymous-storage-NURLs"
|
||||
|
||||
|
||||
# who is responsible for de-duplication?
|
||||
# both?
|
||||
@ -267,8 +269,7 @@ class StorageFarmBroker(service.MultiService):
|
||||
by the given announcement.
|
||||
"""
|
||||
assert isinstance(server_id, bytes)
|
||||
# TODO use constant for anonymous-storage-NURLs
|
||||
if len(server["ann"].get("anonymous-storage-NURLs", [])) > 0:
|
||||
if len(server["ann"].get(ANONYMOUS_STORAGE_NURLS, [])) > 0:
|
||||
s = HTTPNativeStorageServer(server_id, server["ann"])
|
||||
s.on_status_changed(lambda _: self._got_connection())
|
||||
return s
|
||||
@ -961,7 +962,7 @@ class HTTPNativeStorageServer(service.MultiService):
|
||||
) = _parse_announcement(server_id, furl, announcement)
|
||||
# TODO need some way to do equivalent of Happy Eyeballs for multiple NURLs?
|
||||
# https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3935
|
||||
nurl = DecodedURL.from_text(announcement["anonymous-storage-NURLs"][0])
|
||||
nurl = DecodedURL.from_text(announcement[ANONYMOUS_STORAGE_NURLS][0])
|
||||
self._istorage_server = _HTTPStorageServer.from_http_client(
|
||||
StorageClient.from_nurl(nurl, reactor)
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user