def config_changed(self, domain='example.com'): zp = ZoneParser(domain) # Install a skeleton bind zone, rehashes existing file # if it has contents) if not os.path.exists('/etc/bind/db.%s' % domain): self.first_setup(zp, domain) zp.save() self.reload_config()
def config_changed(self): zp = ZoneParser(self.domain) # Install a skeleton bind zone, rehashes existing file # if it has contents) if not os.path.exists("/etc/bind/db.%s" % self.domain): self.first_setup(zp) zp.save() self.reload_config()
def add_record(self, record, domain='example.com'): zp = ZoneParser(domain) if type(record) is dict: zp.dict_to_zone(record) elif type(record) is list: zp.array_to_zone(record) else: raise TypeError("Unsupported type for resource %d" % type(record)) zp.save() self.reload_config()
def remove_record(self, record, domain='example.com'): zp = ZoneParser(domain) zp.zone.remove('alias', record['rr'], record['alias']) zp.save() self.reload_config()
def remove_record(self, record): zp = ZoneParser(self.domain) zp.zone.remove('alias', record['rr'], record['alias']) zp.save() self.reload_config()
def remove_record(self, record): zp = ZoneParser(self.domain) zp.zone.remove("alias", record["rr"], record["alias"]) zp.save() self.reload_config()