From: Kevan Carstensen Date: Sun, 18 Oct 2009 01:30:13 +0000 (-0700) Subject: Alter NoNetworkGrid to allow the creation of readonly servers for testing purposes. X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/module-simplejson.encoder.html?a=commitdiff_plain;h=362f2040757fb8c3cf025cea862995eef567998d;p=tahoe-lafs%2Ftahoe-lafs.git Alter NoNetworkGrid to allow the creation of readonly servers for testing purposes. --- diff --git a/src/allmydata/test/no_network.py b/src/allmydata/test/no_network.py index 1487576f..801714e9 100644 --- a/src/allmydata/test/no_network.py +++ b/src/allmydata/test/no_network.py @@ -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):