U 优化获取主机扩展信息兼容性

pull/442/head
vapao 2021-12-21 17:33:46 +08:00
parent 95952f9348
commit 9a5b390852
1 changed files with 2 additions and 1 deletions

View File

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