From 365d48400757fd9045347fc8ce8404e85662e16c Mon Sep 17 00:00:00 2001 From: vapao Date: Mon, 20 Jun 2022 16:40:49 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E6=94=B9=E8=BF=9B=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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spug_api/apps/host/utils.py b/spug_api/apps/host/utils.py index 097f201..feab7d5 100644 --- a/spug_api/apps/host/utils.py +++ b/spug_api/apps/host/utils.py @@ -202,6 +202,8 @@ def fetch_host_extend(ssh): code, out = ssh.exec_command_raw('hostname -I') if code == 0: for ip in out.strip().split(): + if len(ip) > 15: # ignore ipv6 + continue if ipaddress.ip_address(ip).is_global: if len(public_ip_address) < 10: public_ip_address.add(ip)