mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-31 15:11:27 +00:00
fix: 修复类型问题
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user