From 9a5b390852cfa869c673e456b4880b01c5f20d70 Mon Sep 17 00:00:00 2001 From: vapao Date: Tue, 21 Dec 2021 17:33:46 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=BB=E6=9C=BA=E6=89=A9=E5=B1=95=E4=BF=A1=E6=81=AF=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/apps/host/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spug_api/apps/host/utils.py b/spug_api/apps/host/utils.py index 0b48f3b..463a33c 100644 --- a/spug_api/apps/host/utils.py +++ b/spug_api/apps/host/utils.py @@ -203,7 +203,8 @@ def fetch_host_extend(ssh): if code == 0: for ip in out.strip().split(): if ipaddress.ip_address(ip).is_global: - public_ip_address.add(ip) + if len(public_ip_address) < 10: + public_ip_address.add(ip) elif len(private_ip_address) < 10: private_ip_address.add(ip)