mirror of https://github.com/jumpserver/jumpserver
fix: 修复类型问题
parent
b951ed9206
commit
eedc1ae8b5
|
@ -123,7 +123,7 @@ class BaseAccount(JMSOrgBaseModel):
|
|||
# It does not require this for old-style PEM keys.
|
||||
with open(key_path, 'w') as f:
|
||||
f.write(self.secret)
|
||||
if is_openssh_format_key(self.secret):
|
||||
if is_openssh_format_key(self.secret.encode('utf-8')):
|
||||
f.write("\n")
|
||||
os.chmod(key_path, 0o400)
|
||||
return key_path
|
||||
|
|
|
@ -132,7 +132,7 @@ class BasePlaybookManager:
|
|||
# It does not require this for old-style PEM keys.
|
||||
with open(key_path, 'w') as f:
|
||||
f.write(secret)
|
||||
if is_openssh_format_key(secret):
|
||||
if is_openssh_format_key(secret.encode('utf-8')):
|
||||
f.write("\n")
|
||||
os.chmod(key_path, 0o400)
|
||||
return key_path
|
||||
|
|
Loading…
Reference in New Issue