MCPcopy Create free account
hub / github.com/apache/cloudstack / write_hosts

Method write_hosts

systemvm/debian/opt/cloud/bin/cs/CsDhcp.py:189–198  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

187 self.add_host("ff02::2", "ip6-allrouters")
188
189 def write_hosts(self):
190 file = CsFile("/etc/hosts")
191 file.repopulate()
192 for ip in self.hosts:
193 file.add("%s\t%s" % (ip, self.hosts[ip]))
194 if file.is_changed():
195 file.commit()
196 logging.info("Updated hosts file")
197 else:
198 logging.debug("Hosts file unchanged")
199
200 def add(self, entry):
201 self.add_host(entry['ipv4_address'], entry['host_name'])

Callers 1

processMethod · 0.95

Calls 7

repopulateMethod · 0.95
addMethod · 0.95
is_changedMethod · 0.95
commitMethod · 0.95
CsFileClass · 0.90
debugMethod · 0.80
infoMethod · 0.45

Tested by

no test coverage detected