mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-29 15:43:54 +00:00
added 'debugshell' module a convenient dumping ground for tools for manhole environment
This commit is contained in:
parent
9582494e28
commit
918a1fca23
@ -133,9 +133,14 @@ class _BaseManhole(service.MultiService):
|
||||
|
||||
def makeNamespace():
|
||||
# close over 'self' so we can get access to .parent later
|
||||
namespace = {
|
||||
'app': self.parent,
|
||||
}
|
||||
import types
|
||||
import debugshell
|
||||
debugshell.app = self.parent # make client/queen accesible via 'app'
|
||||
namespace = {}
|
||||
for sym in dir(debugshell):
|
||||
if sym.startswith('__') and sym.endswith('__'):
|
||||
continue
|
||||
namespace[sym] = getattr(debugshell, sym)
|
||||
return namespace
|
||||
|
||||
def makeProtocol():
|
||||
|
17
debugshell.py
Normal file
17
debugshell.py
Normal file
@ -0,0 +1,17 @@
|
||||
import os
|
||||
|
||||
def get_random_bucket_on(nodeid, size=200):
|
||||
d = app.get_remote_service(nodeid, 'storageserver')
|
||||
def get_bucket(rss):
|
||||
return rss.callRemote('allocate_bucket',
|
||||
verifierid=os.urandom(20),
|
||||
bucket_num=26,
|
||||
size=size,
|
||||
leaser=app.tub.tubID,
|
||||
)
|
||||
d.addCallback(get_bucket)
|
||||
return d
|
||||
|
||||
def write_to_bucket(bucket, bytes=100):
|
||||
return bucket.callRemote('write', data=os.urandom(bytes))
|
||||
|
Loading…
x
Reference in New Issue
Block a user