# to a particular owner.
alreadygot = set()
bucketwriters = {} # k: shnum, v: BucketWriter
- si_s = storage_index_to_dir(storage_index)
+ si_dir = storage_index_to_dir(storage_index)
# in this implementation, the lease information (including secrets)
# goes into the share files themselves. It could also be put into a
sf.add_or_renew_lease(lease_info)
for shnum in sharenums:
- incominghome = os.path.join(self.incomingdir, si_s, "%d" % shnum)
- finalhome = os.path.join(self.sharedir, si_s, "%d" % shnum)
+ incominghome = os.path.join(self.incomingdir, si_dir, "%d" % shnum)
+ finalhome = os.path.join(self.sharedir, si_dir, "%d" % shnum)
if os.path.exists(incominghome) or os.path.exists(finalhome):
# great! we already have it. easy.
pass
pass
if bucketwriters:
- fileutil.make_dirs(os.path.join(self.sharedir, si_s))
+ fileutil.make_dirs(os.path.join(self.sharedir, si_dir))
return alreadygot, bucketwriters
secrets,
test_and_write_vectors,
read_vector):
- si_s = storage_index_to_dir(storage_index)
+ si_s = idlib.b2a(storage_index)
+ si_dir = storage_index_to_dir(storage_index)
(write_enabler, renew_secret, cancel_secret) = secrets
# shares exist if there is a file for them
- bucketdir = os.path.join(self.sharedir, si_s)
+ bucketdir = os.path.join(self.sharedir, si_dir)
shares = {}
if os.path.isdir(bucketdir):
for sharenum_s in os.listdir(bucketdir):
return share
def remote_slot_readv(self, storage_index, shares, readv):
- si_s = storage_index_to_dir(storage_index)
+ si_s = idlib.b2a(storage_index)
+ lp = log.msg("storage: slot_readv %s %s" % (si_s, shares),
+ facility="tahoe.storage", level=log.OPERATIONAL)
+ si_dir = storage_index_to_dir(storage_index)
# shares exist if there is a file for them
- bucketdir = os.path.join(self.sharedir, si_s)
+ bucketdir = os.path.join(self.sharedir, si_dir)
if not os.path.isdir(bucketdir):
return {}
datavs = {}
filename = os.path.join(bucketdir, sharenum_s)
msf = MutableShareFile(filename, self)
datavs[sharenum] = msf.readv(readv)
+ log.msg("returning shares %s" % (datavs.keys(),),
+ facility="tahoe.storage", level=log.NOISY, parent=lp)
return datavs
#self.failUnlessEqual(s0.remote_get_length(), 100)
bad_secrets = ("bad write enabler", secrets[1], secrets[2])
- self.failUnlessRaises(BadWriteEnablerError,
- write, "si1", bad_secrets,
- {}, [])
+ f = self.failUnlessRaises(BadWriteEnablerError,
+ write, "si1", bad_secrets,
+ {}, [])
+ self.failUnless("The write enabler was recorded by nodeid 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'." in f, f)
# this testv should fail
answer = write("si1", secrets,