]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Tweak options rotate.
authorBob Halley <halley@dnspython.org>
Sun, 31 Aug 2014 23:36:03 +0000 (16:36 -0700)
committerBob Halley <halley@dnspython.org>
Sun, 31 Aug 2014 23:36:03 +0000 (16:36 -0700)
ChangeLog
dns/resolver.py

index 3370282140cc86f6611b79f2352a421fe62166c7..f6dbf784c5c9bf2f2a7bc656bf91ef5f0f63ddc8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2014-08-31  Bob Halley  <halley@dnspython.org>
+
+       * The /etc/resolv.conf setting "options rotate" is now understood
+         by the resolver.  If present, the resolver will shuffle the
+         nameserver list each time dns.resolver.query() is called.  Thanks
+         to underrun for the patch.  Note that you don't want to add
+         "options rotate" to your /etc/resolv.conf if your system's
+         resolver library does not understand it.  In this case, just set
+         resolver.rotate = True by hand.
+
 2014-04-11  Bob Halley  <halley@dnspython.org>
 
        * dns/zone.py: Do not put back an unescaped token.  This was
index 97bd0a886bce49f19585547f965564eebc6ed0a8..3d3cccbda6d6a89e7124b079919e0a69304c4078 100644 (file)
@@ -543,7 +543,7 @@ class Resolver(object):
                     for suffix in tokens[1:]:
                         self.search.append(dns.name.from_text(suffix))
                 elif tokens[0] == 'options':
-                    if len(tokens) == 2 and tokens[1] == 'rotate':
+                    if 'rotate' in tokens[1:]:
                         self.rotate = True
         finally:
             if want_close: