From 38b37b132f310c6a3cf8ae58d60b207daf668e89 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 15 Dec 2013 18:44:33 +0100 Subject: [PATCH] dnstools: reviewed/improved docstrings --- nsupdate/main/dnstools.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nsupdate/main/dnstools.py b/nsupdate/main/dnstools.py index 33dad23..0012edc 100644 --- a/nsupdate/main/dnstools.py +++ b/nsupdate/main/dnstools.py @@ -161,7 +161,8 @@ def query_ns(qname, rdtype, origin=None): :type rdtype: int or str :param origin: origin zone :type origin: str or None - :return: IP (as str) or "-" if ns is not available + :return: IP (as str) + :raises: see dns.resolver.Resolver.query """ origin, name = parse_name(qname, origin) fqdn = name + origin @@ -274,6 +275,7 @@ def update_ns(fqdn, rdtype='A', ipaddr=None, origin=None, action='upd', ttl=60): :param action: 'add', 'del' or 'upd' :param ttl: time to live for the added/updated resource, default 60s (int) :return: dns response + :raises: DnsUpdateError, Timeout """ assert action in ['add', 'del', 'upd', ] nameserver, origin, domain, name, keyname, key, algo = get_ns_info(fqdn, origin) @@ -340,7 +342,7 @@ def put_ip_into_session(session, ipaddr, kind=None, max_age=0, :param ipaddr: ip address (can be v4 or v6, str) :param kind: 'ipv4' or 'ipv6' or None to autodetect :param max_age: maximum age of info, if older we refresh the timestamp - :param save: save the session, if it was changed + :param save: save the session immediately, if it was changed """ if kind is None: kind = check_ip(ipaddr)