macOS: enable live autosigning (bugfix)
This commit is contained in:
parent
f4183a0c9e
commit
d5939ef063
5 changed files with 12 additions and 11 deletions
|
|
@ -731,7 +731,10 @@ class Autosign:
|
|||
if sys.platform == 'linux':
|
||||
return self.dev_label_path.exists()
|
||||
elif sys.platform == 'darwin':
|
||||
return self.mountpoint.exists()
|
||||
if self.cfg.test_suite_root_pfx:
|
||||
return self.mountpoint.exists()
|
||||
else:
|
||||
return run(['diskutil', 'info', self.dev_label], stdout=DEVNULL, stderr=DEVNULL).returncode == 0
|
||||
|
||||
async def main_loop(self):
|
||||
if not self.cfg.stealth_led:
|
||||
|
|
|
|||
|
|
@ -128,10 +128,9 @@ silent = cfg.yes and cfg.fee is not None and cfg.output_to_reduce is not None
|
|||
async def main():
|
||||
|
||||
if cfg.autosign:
|
||||
from .tx.util import init_removable_device
|
||||
from .tx.util import mount_removable_device
|
||||
from .autosign import Signable
|
||||
asi = init_removable_device(cfg)
|
||||
asi.do_mount()
|
||||
asi = mount_removable_device(cfg)
|
||||
si = Signable.automount_transaction(asi)
|
||||
if si.unsigned or si.unsent:
|
||||
state = 'unsigned' if si.unsigned else 'unsent'
|
||||
|
|
|
|||
|
|
@ -87,10 +87,9 @@ cfg = Config(opts_data=opts_data)
|
|||
async def main():
|
||||
|
||||
if cfg.autosign:
|
||||
from .tx.util import init_removable_device
|
||||
from .tx.util import mount_removable_device
|
||||
from .autosign import Signable
|
||||
asi = init_removable_device(cfg)
|
||||
asi.do_mount()
|
||||
asi = mount_removable_device(cfg)
|
||||
Signable.automount_transaction(asi).check_create_ok()
|
||||
|
||||
from .tx import NewTX
|
||||
|
|
|
|||
|
|
@ -63,10 +63,9 @@ if len(cfg._args) == 1:
|
|||
from .fileutil import check_infile
|
||||
check_infile(infile)
|
||||
elif not cfg._args and cfg.autosign:
|
||||
from .tx.util import init_removable_device
|
||||
from .tx.util import mount_removable_device
|
||||
from .autosign import Signable
|
||||
asi = init_removable_device(cfg)
|
||||
asi.do_mount()
|
||||
asi = mount_removable_device(cfg)
|
||||
si = Signable.automount_transaction(asi)
|
||||
if cfg.abort:
|
||||
si.shred_abortable() # prompts user, then raises exception or exits
|
||||
|
|
|
|||
|
|
@ -25,11 +25,12 @@ def get_autosign_obj(cfg):
|
|||
})
|
||||
)
|
||||
|
||||
def init_removable_device(cfg):
|
||||
def mount_removable_device(cfg):
|
||||
asi = get_autosign_obj(cfg)
|
||||
if not asi.device_inserted:
|
||||
from ..util import die
|
||||
die(1, 'Removable device not present!')
|
||||
import atexit
|
||||
atexit.register(lambda: asi.do_umount())
|
||||
asi.do_mount()
|
||||
return asi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue