fix: 修复ssh-private-key错误导致系统用户列表加载出现500的问题

pull/6540/head
Bai 2021-07-23 18:28:41 +08:00 committed by 老广
parent 938255df6f
commit 160b238058
1 changed files with 4 additions and 1 deletions

View File

@ -67,7 +67,10 @@ class AuthMixin:
if self.public_key:
public_key = self.public_key
elif self.private_key:
try:
public_key = ssh_pubkey_gen(private_key=self.private_key, password=self.password)
except IOError as e:
return str(e)
else:
return ''