Revision 7e3dbb94
b/lib/utils.py | ||
---|---|---|
765 | 765 |
written = False |
766 | 766 |
for line in f: |
767 | 767 |
fields = line.split() |
768 |
if not fields[0].startswith('#') and ip == fields[0]: |
|
768 |
if fields and not fields[0].startswith('#') and ip == fields[0]:
|
|
769 | 769 |
continue |
770 | 770 |
out.write(line) |
771 | 771 |
|
772 |
out.write("%s %s" % (ip, hostname))
|
|
772 |
out.write("%s\t%s" % (ip, hostname))
|
|
773 | 773 |
if aliases: |
774 | 774 |
out.write(" %s" % ' '.join(aliases)) |
775 | 775 |
out.write('\n') |
Also available in: Unified diff