fix: 修复类型问题

pull/9851/head
Eric 2023-03-02 19:05:27 +08:00
parent b951ed9206
commit eedc1ae8b5
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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