tx, autosign overlay: minor cleanups
This commit is contained in:
parent
b3764f6a4e
commit
d249f1dc87
2 changed files with 6 additions and 8 deletions
|
|
@ -74,8 +74,6 @@ async def _get_twctl(d):
|
|||
'AutomountSent'):
|
||||
from ..tw.ctl import TwCtl
|
||||
return await TwCtl(d.cfg, d.proto, no_rpc=True)
|
||||
else:
|
||||
return None
|
||||
|
||||
def _get(clsname, modname, kwargs):
|
||||
ret = _get_cls_info(clsname, modname, **kwargs)
|
||||
|
|
|
|||
|
|
@ -3,21 +3,21 @@ from .__init___orig import *
|
|||
class overlay_fake_Autosign:
|
||||
|
||||
def init_fixup(self):
|
||||
if pfx := self.cfg.test_suite_autosign_root_dir:
|
||||
subdir = pfx + '/' + ('online' if self.cfg.online else 'offline')
|
||||
if self.cfg.test_suite_autosign_root_dir and self.mountpoint.anchor:
|
||||
root_dir = os.path.join(
|
||||
self.cfg.test_suite_autosign_root_dir,
|
||||
'online' if self.cfg.online else 'offline')
|
||||
for k in ('mountpoint', 'shm_dir', 'wallet_dir'):
|
||||
orig_path = str(getattr(self, k))
|
||||
setattr(self, k, Path(subdir + orig_path.removeprefix(subdir)))
|
||||
setattr(self, k, Path(root_dir + str(getattr(self, k))))
|
||||
# mount --type=fuse-ext2 --options=rw+ ### current fuse-ext2 (0.4 29) is buggy - can’t use
|
||||
import sys
|
||||
if sys.platform == 'linux':
|
||||
self.dev_label = 'MMGEN_TS_ONLINE' if self.cfg.online else 'MMGEN_TS_OFFLINE'
|
||||
self.mount_cmd = f'sudo mount LABEL={self.dev_label} {self.mountpoint}'
|
||||
self.umount_cmd = f'sudo umount {self.mountpoint}'
|
||||
self.linux_blkid_cmd = 'sudo blkid -s LABEL -o value'
|
||||
|
||||
Autosign.dev_label = 'MMGEN_TS_TX' # autosign_live only (Linux)
|
||||
Autosign.linux_mount_subdir = 'mmgen_ts_autosign'
|
||||
Autosign.linux_blkid_cmd = 'sudo blkid -s LABEL -o value'
|
||||
Autosign.macOS_ramdisk_name = 'TestAutosignRamDisk'
|
||||
Autosign.init_fixup = overlay_fake_Autosign.init_fixup
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue