def analyzeHostfile(self, hostfile):
try:
with open(hostfile) as f:
allHosts=[]
for line in f:
if line[0]=='#':
pass
else:
if len(line.split())==1:
allHosts.append(line.strip())
else:
raise
return allHosts
except:
print "Invalid host file formatting!"
sys.exit()
评论列表
文章目录