set handler if no password is provided

This commit is contained in:
Kay0u 2020-01-02 12:34:47 +08:00
parent fdb4db0124
commit 0be1d74e4a
No known key found for this signature in database
GPG key ID: 7FF262C033518333

View file

@ -446,6 +446,9 @@ class Interface(BaseInterface):
# Set handler for authentication
if password:
msignals.set_handler("authenticate", lambda a: a(password=password))
else:
if os.isatty(1):
msignals.set_handler("authenticate", self._do_authenticate)
try:
ret = self.actionsmap.process(args, timeout=timeout)