mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-20 03:36:25 +00:00
Alter NoNetworkGrid to allow the creation of readonly servers for testing purposes.
This commit is contained in:
parent
1338318644
commit
362f204075
@ -216,12 +216,13 @@ class NoNetworkGrid(service.MultiService):
|
||||
c.setServiceParent(self)
|
||||
self.clients.append(c)
|
||||
|
||||
def make_server(self, i):
|
||||
def make_server(self, i, readonly=False):
|
||||
serverid = hashutil.tagged_hash("serverid", str(i))[:20]
|
||||
serverdir = os.path.join(self.basedir, "servers",
|
||||
idlib.shortnodeid_b2a(serverid))
|
||||
fileutil.make_dirs(serverdir)
|
||||
ss = StorageServer(serverdir, serverid, stats_provider=SimpleStats())
|
||||
ss = StorageServer(serverdir, serverid, stats_provider=SimpleStats(),
|
||||
readonly_storage=readonly)
|
||||
return ss
|
||||
|
||||
def add_server(self, i, ss):
|
||||
|
Loading…
Reference in New Issue
Block a user