systemvm: Fix hostname is localhost in some VRs (#3422)

In some virtual routers, 'hostname -f' returns 'localhost'. The hostname is also 'localhost' in `/var/log/messages`. This change can fix the issue in new VRs.
This commit is contained in:
ustcweizhou 2019-06-26 12:56:05 +02:00 committed by Rohit Yadav
parent 6f1fc18332
commit e76266e39b

View File

@ -139,7 +139,8 @@ class CsDhcp(CsDataBag):
logging.error("Caught error while trying to delete entries from dnsmasq.leases file: %s" % e)
def preseed(self):
self.add_host("127.0.0.1", "localhost %s" % CsHelper.get_hostname())
self.add_host("127.0.0.1", "localhost")
self.add_host("127.0.1.1", "%s" % CsHelper.get_hostname())
self.add_host("::1", "localhost ip6-localhost ip6-loopback")
self.add_host("ff02::1", "ip6-allnodes")
self.add_host("ff02::2", "ip6-allrouters")