mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 08:25:35 +00:00
fix StorageFarmBroker constructors after connected_d gone
This commit is contained in:
parent
b65a8fe142
commit
4c619ac98d
@ -378,8 +378,9 @@ class Client(node.Node, pollmixin.PollMixin):
|
||||
self.encoding_params["happy"] + 1)
|
||||
|
||||
sb = storage_client.StorageFarmBroker(self.tub, True, connection_threshold,
|
||||
self.upload_ready_d, preferred_peers=preferred_peers)
|
||||
preferred_peers=preferred_peers)
|
||||
self.storage_broker = sb
|
||||
self.upload_ready_d = self.storage_broker.when_connected_enough()
|
||||
|
||||
# load static server specifications from tahoe.cfg, if any.
|
||||
# Not quite ready yet.
|
||||
|
@ -22,7 +22,7 @@ class FakeClient:
|
||||
class WebResultsRendering(unittest.TestCase, WebRenderingMixin):
|
||||
|
||||
def create_fake_client(self):
|
||||
sb = StorageFarmBroker(None, True, 0, None)
|
||||
sb = StorageFarmBroker(None, True, 0)
|
||||
# s.get_name() (the "short description") will be "v0-00000000".
|
||||
# s.get_longname() will include the -long suffix.
|
||||
# s.get_peerid() (i.e. tubid) will be "aaa.." or "777.." or "ceir.."
|
||||
|
@ -236,7 +236,7 @@ class Basic(testutil.ReallyEqualMixin, unittest.TestCase):
|
||||
return [ s.get_longname() for s in sb.get_servers_for_psi(key) ]
|
||||
|
||||
def test_permute(self):
|
||||
sb = StorageFarmBroker(None, True, 0, None)
|
||||
sb = StorageFarmBroker(None, True, 0)
|
||||
for k in ["%d" % i for i in range(5)]:
|
||||
ann = {"anonymous-storage-FURL": "pb://abcde@nowhere/fake",
|
||||
"permutation-seed-base32": base32.b2a(k) }
|
||||
@ -248,7 +248,7 @@ class Basic(testutil.ReallyEqualMixin, unittest.TestCase):
|
||||
self.failUnlessReallyEqual(self._permute(sb, "one"), [])
|
||||
|
||||
def test_permute_with_preferred(self):
|
||||
sb = StorageFarmBroker(None, True, ['1','4'])
|
||||
sb = StorageFarmBroker(None, True, 5, ['1','4'])
|
||||
for k in ["%d" % i for i in range(5)]:
|
||||
ann = {"anonymous-storage-FURL": "pb://abcde@nowhere/fake",
|
||||
"permutation-seed-base32": base32.b2a(k) }
|
||||
|
@ -116,7 +116,7 @@ class AssistedUpload(unittest.TestCase):
|
||||
timeout = 240 # It takes longer than 120 seconds on Francois's arm box.
|
||||
def setUp(self):
|
||||
self.s = FakeClient()
|
||||
self.s.storage_broker = StorageFarmBroker(None, True, 0, None)
|
||||
self.s.storage_broker = StorageFarmBroker(None, True, 0)
|
||||
self.s.secret_holder = client.SecretHolder("lease secret", "converge")
|
||||
self.s.startService()
|
||||
|
||||
|
@ -234,7 +234,7 @@ def make_storagebroker(s=None, num_peers=10):
|
||||
s = FakeStorage()
|
||||
peerids = [tagged_hash("peerid", "%d" % i)[:20]
|
||||
for i in range(num_peers)]
|
||||
storage_broker = StorageFarmBroker(None, True, 0, None)
|
||||
storage_broker = StorageFarmBroker(None, True, 0)
|
||||
for peerid in peerids:
|
||||
fss = FakeStorageServer(peerid, s)
|
||||
ann = {"anonymous-storage-FURL": "pb://%s@nowhere/fake" % base32.b2a(peerid),
|
||||
|
@ -198,7 +198,7 @@ class FakeClient:
|
||||
mode = dict([i,mode] for i in range(num_servers))
|
||||
servers = [ ("%20d"%fakeid, FakeStorageServer(mode[fakeid]))
|
||||
for fakeid in range(self.num_servers) ]
|
||||
self.storage_broker = StorageFarmBroker(None, True, 0, None)
|
||||
self.storage_broker = StorageFarmBroker(None, True, 0)
|
||||
for (serverid, rref) in servers:
|
||||
ann = {"anonymous-storage-FURL": "pb://%s@nowhere/fake" % base32.b2a(serverid),
|
||||
"permutation-seed-base32": base32.b2a(serverid) }
|
||||
|
@ -248,7 +248,7 @@ class FakeClient(Client):
|
||||
self._secret_holder = SecretHolder("lease secret", "convergence secret")
|
||||
self.helper = None
|
||||
self.convergence = "some random string"
|
||||
self.storage_broker = StorageFarmBroker(None, True, 0, None)
|
||||
self.storage_broker = StorageFarmBroker(None, True, 0)
|
||||
# fake knowledge of another server
|
||||
self.storage_broker.test_add_server("other_nodeid",
|
||||
FakeDisplayableServer(
|
||||
|
Loading…
x
Reference in New Issue
Block a user