CLOUDSTACK-9583: VR: In CsDhcp.py preseed both hostaname and

localhost to resolve to 127.0.0.1

 ensuring for both vpc and non vpc vr, both localhost and hostname is resolved to 127.0.0.1
This commit is contained in:
Murali Reddy 2016-11-18 11:11:54 +05:30
parent 31ff13d016
commit 16a0fbb02f
1 changed files with 2 additions and 4 deletions

View File

@ -44,7 +44,7 @@ class CsDhcp(CsDataBag):
continue
self.add(self.dbag[item])
self.write_hosts()
if self.cloud.is_changed():
self.delete_leases()
@ -103,12 +103,10 @@ class CsDhcp(CsDataBag):
return
def preseed(self):
self.add_host("127.0.0.1", "localhost")
self.add_host("127.0.0.1", "localhost %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")
if self.config.is_vpc():
self.add_host("127.0.0.1", CsHelper.get_hostname())
if self.config.is_router():
self.add_host(self.config.address().get_guest_ip(), "%s data-server" % CsHelper.get_hostname())