Merge pull request #110 from matkoniecz/hostname

include 127.0.1.1 <hostname> line
This commit is contained in:
Steven Black 2016-03-20 12:17:41 -04:00
commit f18700c676

View File

@ -23,6 +23,7 @@ import tempfile
import time
import glob
import argparse
import socket
# zip files are not used actually, support deleted
# StringIO is not needed in Python 3
# Python 3 works differently with urlopen
@ -382,6 +383,8 @@ def writeOpeningHeader(finalFile):
writeData(finalFile, '255.255.255.255 broadcasthost\n')
writeData(finalFile, '::1 localhost\n')
writeData(finalFile, 'fe80::1%lo0 localhost\n')
if platform.system() == 'Linux':
writeData(finalFile, '127.0.1.1 ' + socket.gethostname() + '\n')
writeData(finalFile, '\n')
preamble = os.path.join(BASEDIR_PATH, "myhosts")