(self)
| 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']) |
no test coverage detected