Browse Source

fix: 解决openssh低版本时测试可连接失败问题

pull/12539/head
halo 10 months ago committed by 老广
parent
commit
644eada8a1
  1. 15
      apps/ops/ansible/modules_utils/custom_common.py

15
apps/ops/ansible/modules_utils/custom_common.py

@ -4,6 +4,21 @@ import time
import paramiko
from sshtunnel import SSHTunnelForwarder
from packaging import version
if version.parse(paramiko.__version__) > version.parse("2.8.1"):
_preferred_pubkeys = (
"ssh-ed25519",
"ecdsa-sha2-nistp256",
"ecdsa-sha2-nistp384",
"ecdsa-sha2-nistp521",
"ssh-rsa",
"rsa-sha2-256",
"rsa-sha2-512",
"ssh-dss",
)
paramiko.transport.Transport._preferred_pubkeys = _preferred_pubkeys
def common_argument_spec():
options = dict(

Loading…
Cancel
Save