updated bind-restful for python3

This commit is contained in:
Paul 2019-12-07 18:53:51 +01:00
parent c1495cf800
commit 2ee48c71e1
4 changed files with 15 additions and 13 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.pyc
*.ini

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import ConfigParser
import configparser
import dns.tsigkeyring
import dns.resolver
import dns.update
@ -20,7 +20,7 @@ def parse_config(config):
password required to perform dynamic DNS updates
"""
options = {}
parser = ConfigParser.ConfigParser()
parser = configparser.ConfigParser()
parser.read(config)
options['nameserver'] = parser.get('nameserver', 'server')
@ -151,4 +151,4 @@ def dns_mgmt(domain, ttl, record_type, response):
if __name__ == '__main__':
app.run(debug=True)
app.run(host='0.0.0.0',port=5001,debug=True)

View File

@ -1,9 +0,0 @@
[nameserver]
server = 172.16.33.135
[auth]
username = TRANSFER
password = /h9xIk0tbF3A0lOzy6BYAQ==
[zones]
valid = ops.internal.net,eng.internal.net

9
config.ini.sample Normal file
View File

@ -0,0 +1,9 @@
[nameserver]
server = 127.0.0.1
[auth]
username = example.com.
password = hS7nabA8gHDEiGmZD+tyCDWYtcY8D3rH6pPlzbIrYGv6KJ7JF+b14sDjqrpriIqOlJhY7P0lBec8DsjOzuQNaw==
[zones]
valid = example.com