aboutsummaryrefslogtreecommitdiffstats
path: root/ddns/backend/dnsupdate.py
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2014-03-18 02:15:57 +0100
committerMarius Halden <marius.h@lden.org>2014-03-18 02:15:57 +0100
commite19e0f0eeb14a7ffacaa56a2357e26deff9bb5cf (patch)
tree0de940b470fcb7916a85b994d1f8e5756dcd813e /ddns/backend/dnsupdate.py
parentd5e090eb4b894e93ae4ed0ed01e66eac7df79300 (diff)
downloadDDNS.py-e19e0f0eeb14a7ffacaa56a2357e26deff9bb5cf.tar.gz
DDNS.py-e19e0f0eeb14a7ffacaa56a2357e26deff9bb5cf.tar.bz2
DDNS.py-e19e0f0eeb14a7ffacaa56a2357e26deff9bb5cf.tar.xz
Fixed bug left after config change
Diffstat (limited to 'ddns/backend/dnsupdate.py')
-rw-r--r--ddns/backend/dnsupdate.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/ddns/backend/dnsupdate.py b/ddns/backend/dnsupdate.py
index b64cefd..6554fbb 100644
--- a/ddns/backend/dnsupdate.py
+++ b/ddns/backend/dnsupdate.py
@@ -28,7 +28,7 @@ def get_zone(name):
return None
def get_key(name):
- for key in cfg['dnskeys']:
+ for key in ddns.cfg_parser.cfg['dnskeys']:
if key['name'] == name:
return key
return None
@@ -64,9 +64,11 @@ def update_dns(zone, hostname, ip, ttl=300):
zone = get_zone(zone)
dns_srv = zone['ns']
+ key = get_key(zone['key'])
+
update = dns.update.Update(zone['name'], keyring=keyring, \
- keyname=zone['key']['name'], \
- keyalgorithm=get_hash_method(zone['key']['algorithm']))
+ keyname=key['name'], \
+ keyalgorithm=get_hash_method(key['algorithm']))
if ip.version() == 6:
rtype = 'AAAA'