diff --git a/nsupdate/main/_tests/test_dnstools.py b/nsupdate/main/_tests/test_dnstools.py index f945bd1..d4e2a67 100644 --- a/nsupdate/main/_tests/test_dnstools.py +++ b/nsupdate/main/_tests/test_dnstools.py @@ -13,9 +13,6 @@ from dns.resolver import NXDOMAIN class TestQuery(object): def test_queries_ok(self): - """ - check some simple dns lookups - """ assert query_ns(WWW_IPV4_HOST, 'A') == WWW_IPV4_IP # v4 ONLY assert query_ns(WWW_IPV6_HOST, 'AAAA') == WWW_IPV6_IP # v6 ONLY assert query_ns(WWW_HOST, 'A') == WWW_IPV4_IP # v4 and v6, query v4 @@ -30,9 +27,6 @@ class TestQuery(object): class TestUpdate(object): def test_parse1(self): - """ - check fqdn parsing - """ origin, relname = parse_name('foo.' + BASEDOMAIN) assert str(origin) == BASEDOMAIN + '.' assert str(relname) == 'foo' diff --git a/nsupdate/main/dnstools.py b/nsupdate/main/dnstools.py index 762babc..6dcdd69 100644 --- a/nsupdate/main/dnstools.py +++ b/nsupdate/main/dnstools.py @@ -67,9 +67,13 @@ def update_ns(fqdn, rdtype='A', ipaddr=None, origin=None, action='upd', ttl=60): """ update our master server - :param qname: the name to update - :param rdtype: the record type + :param fqdn: the fully qualified domain name to update (str) + :param rdtype: the record type (default: 'A') (str) + :param ipaddr: ip address (v4 or v6), if needed (str) + :param origin: the origin zone to update (default; autodetect) (str) :param action: 'add', 'del' or 'upd' + :param ttl: time to live for the added/updated resource, default 60s (int) + :return: dns response """ assert action in ['add', 'del', 'upd', ] origin, name = parse_name(fqdn, origin)