From: Brian Warner Date: Sat, 27 Aug 2011 19:06:02 +0000 (-0700) Subject: MDMF: more writable/writeable consistentifications X-Git-Url: https://git.rkrishnan.org/pf/content/en/service/sitemap.html?a=commitdiff_plain;h=522868d5e92e27e5c3c7b6fca9afeb3caadc9b49;p=tahoe-lafs%2Ftahoe-lafs.git MDMF: more writable/writeable consistentifications --- diff --git a/src/allmydata/immutable/upload.py b/src/allmydata/immutable/upload.py index d152c44d..1a573184 100644 --- a/src/allmydata/immutable/upload.py +++ b/src/allmydata/immutable/upload.py @@ -220,9 +220,9 @@ class Tahoe2ServerSelector(log.PrefixingLogMixin): v0 = server.get_rref().version v1 = v0["http://allmydata.org/tahoe/protocols/storage/v1"] return v1["maximum-immutable-share-size"] - writable_servers = [server for server in all_servers + writeable_servers = [server for server in all_servers if _get_maxsize(server) >= allocated_size] - readonly_servers = set(all_servers[:2*total_shares]) - set(writable_servers) + readonly_servers = set(all_servers[:2*total_shares]) - set(writeable_servers) # decide upon the renewal/cancel secrets, to include them in the # allocate_buckets query. @@ -257,7 +257,7 @@ class Tahoe2ServerSelector(log.PrefixingLogMixin): # second-pass list and repeat the "second" pass (really the third, # fourth, etc pass), until all shares are assigned, or we've run out # of potential servers. - self.first_pass_trackers = _make_trackers(writable_servers) + self.first_pass_trackers = _make_trackers(writeable_servers) self.second_pass_trackers = [] # servers worth asking again self.next_pass_trackers = [] # servers that we have asked again self._started_second_pass = False diff --git a/src/allmydata/mutable/filenode.py b/src/allmydata/mutable/filenode.py index 9f70e210..59438b87 100644 --- a/src/allmydata/mutable/filenode.py +++ b/src/allmydata/mutable/filenode.py @@ -478,7 +478,7 @@ class MutableFileNode: I return a Deferred that fires with a MutableFileVersion representing the best readable version of the file that I represent. I am like get_best_readable_version, except that I - will try to make a writable version if I can. + will try to make a writeable version if I can. """ return self.get_mutable_version(servermap=servermap) diff --git a/src/allmydata/test/test_uri.py b/src/allmydata/test/test_uri.py index e1bb7d71..7662c7f8 100644 --- a/src/allmydata/test/test_uri.py +++ b/src/allmydata/test/test_uri.py @@ -347,7 +347,7 @@ class Mutable(testutil.ReallyEqualMixin, unittest.TestCase): self.failUnlessReallyEqual(u5, u5_h) - def test_writable_mdmf_cap(self): + def test_writeable_mdmf_cap(self): u1 = uri.WriteableMDMFFileURI(self.writekey, self.fingerprint) cap = u1.to_string() u = uri.WriteableMDMFFileURI.init_from_string(cap) @@ -359,7 +359,7 @@ class Mutable(testutil.ReallyEqualMixin, unittest.TestCase): self.failIf(u.is_readonly()) self.failUnlessEqual(cap, u.to_string()) - # Now get a readonly cap from the writable cap, and test that it + # Now get a readonly cap from the writeable cap, and test that it # degrades gracefully. ru = u.get_readonly() self.failUnlessReallyEqual(self.readkey, ru.readkey) @@ -387,8 +387,8 @@ class Mutable(testutil.ReallyEqualMixin, unittest.TestCase): self.failUnlessEqual(vu.storage_index, self.storage_index) self.failUnlessEqual(vu.fingerprint, self.fingerprint) - def test_create_writable_mdmf_cap_from_readcap(self): - # we shouldn't be able to create a writable MDMF cap given only a + def test_create_writeable_mdmf_cap_from_readcap(self): + # we shouldn't be able to create a writeable MDMF cap given only a # readcap. u1 = uri.ReadonlyMDMFFileURI(self.readkey, self.fingerprint) cap = u1.to_string() @@ -396,7 +396,7 @@ class Mutable(testutil.ReallyEqualMixin, unittest.TestCase): uri.WriteableMDMFFileURI.init_from_string, cap) - def test_create_writable_mdmf_cap_from_verifycap(self): + def test_create_writeable_mdmf_cap_from_verifycap(self): u1 = uri.MDMFVerifierURI(self.storage_index, self.fingerprint) cap = u1.to_string() self.failUnlessRaises(uri.BadURIError,