Skip to content

Commit b6eec98

Browse files
committed
Fix for /etc/hosts parsing
1 parent 5291d61 commit b6eec98

File tree

1 file changed

+2
-0
lines changed
  • psconfig/perfsonar-psconfig/psconfig/utilities

1 file changed

+2
-0
lines changed

psconfig/perfsonar-psconfig/psconfig/utilities/dns.py

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def read_etc_hosts():
1414
with open('/etc/hosts', 'r') as file:
1515
for line in file:
1616
entry = line.split()
17+
if not entry or len(entry) < 2:
18+
continue
1719
ip_hosts[entry[0]] = entry[1:]
1820
for host in entry[1:]:
1921
host_ips[host] = host_ips.get(host, []) + [entry[0]]

0 commit comments

Comments
 (0)