Fix RNDC reload

This commit is contained in:
2017-05-27 18:52:07 +01:00
parent d2f1ed76e5
commit 7b0eaf0fba

View File

@@ -73,7 +73,7 @@ def parse_blacklist(format, filename=None, fobj=None):
def write_rpz(hosts, filename, origin='rpz.black.hole'):
"""Produces a basic Bind RPZ zone file from a list of hosts"""
rpz_header = ["$TTL 60", "$ORIGIN %s" % origin, "@ SOA nonexistent.nodomain.none. dummy.nodomain.none. %d 12h 15m 3w 2h" % time.time(), "NS nonexistant.nodomain.none"]
rpz_header = ["$TTL 60", "$ORIGIN %s" % origin, "@ SOA nonexistent.nodomain.none. dummy.nodomain.none. %d 12h 15m 3w 2h" % time.time(), "@ NS nonexistant.nodomain.none"]
with open(filename, 'wb') as fobj:
for line in rpz_header:
fobj.write('%s\n' % line)
@@ -152,7 +152,7 @@ def main():
# reload RPZ
if args.reloadzone:
_logger.info('Informing Bind to reload the zone')
res = subprocess.call('rndc reload %s' % config['origin'])
res = subprocess.call('rndc reload %' % config['origin'], shell=True)
if __name__ == '__main__':
main()