repair: fix test to map from storage index to directory structure properly (thanks, cygwin buildbot, for being so kloodgey that you won't accept random binary filenames and thus making me notice this bug)

This commit is contained in:
Zooko O'Whielacronx 2008-09-26 15:49:13 -07:00
parent cd0af638f3
commit 2e8b89e9e4

View File

@ -14,6 +14,7 @@ from allmydata.immutable.encode import NotEnoughSharesError
from allmydata.checker_results import CheckerResults, CheckAndRepairResults, \
DeepCheckResults, DeepCheckAndRepairResults
from allmydata.mutable.common import CorruptShareError
from allmydata.storage import storage_index_to_dir
from allmydata.util import log, testutil, fileutil
from allmydata.stats import PickleStatsGatherer
from allmydata.key_generator import KeyGeneratorService
@ -845,7 +846,7 @@ class ShareManglingMixin(SystemTestMixin):
os.unlink(pathtosharefile)
for ((clientnum, sharenum), newdata) in newshares.iteritems():
if clientnum == i:
fullsharedirp=os.path.join(sharedir, storage_index[:2], storage_index)
fullsharedirp=os.path.join(sharedir, storage_index_to_dir(storage_index))
fileutil.make_dirs(fullsharedirp)
wf = open(os.path.join(fullsharedirp, str(sharenum)), "w")
wf.write(newdata)