From 644eada8a1faad46f1e9409e2f829de138d78d22 Mon Sep 17 00:00:00 2001 From: halo Date: Sat, 13 Jan 2024 19:40:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3openssh=E4=BD=8E?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=97=B6=E6=B5=8B=E8=AF=95=E5=8F=AF=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/ansible/modules_utils/custom_common.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/ops/ansible/modules_utils/custom_common.py b/apps/ops/ansible/modules_utils/custom_common.py index 0cf1420d2..7015ff2f9 100644 --- a/apps/ops/ansible/modules_utils/custom_common.py +++ b/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(