Skip to content

Commit e76266e

Browse files
ustcweizhouyadvr
authored andcommitted
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.
1 parent 6f1fc18 commit e76266e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

systemvm/debian/opt/cloud/bin/cs/CsDhcp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ def delete_leases(self):
139139
logging.error("Caught error while trying to delete entries from dnsmasq.leases file: %s" % e)
140140

141141
def preseed(self):
142-
self.add_host("127.0.0.1", "localhost %s" % CsHelper.get_hostname())
142+
self.add_host("127.0.0.1", "localhost")
143+
self.add_host("127.0.1.1", "%s" % CsHelper.get_hostname())
143144
self.add_host("::1", "localhost ip6-localhost ip6-loopback")
144145
self.add_host("ff02::1", "ip6-allnodes")
145146
self.add_host("ff02::2", "ip6-allrouters")

0 commit comments

Comments
 (0)