aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-04 19:04:45 +0800
committerAaron LI <aly@aaronly.me>2018-03-14 11:35:08 +0800
commitf8b515e0218e5011044f5e2ebc49bcdc4a0b8e7a (patch)
tree22163dcf92eb317dd98323b1519e2ede697f446a
parent91883b0b5498e38e2626b0c9792fd2a23a967d9e (diff)
downloadansible-dfly-vps-f8b515e0218e5011044f5e2ebc49bcdc4a0b8e7a.tar.bz2
filter/dns: next_serial do not query the registry nameserver
-rw-r--r--filter_plugins/dns.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/filter_plugins/dns.py b/filter_plugins/dns.py
index 89f2159..7f1da54 100644
--- a/filter_plugins/dns.py
+++ b/filter_plugins/dns.py
@@ -9,7 +9,6 @@ The templating is done on the local/control machine!
import os
import datetime
-import random
import shlex
import subprocess
@@ -49,15 +48,7 @@ def next_serial(fqdn):
if cmd_path is None:
raise Exception("Cannot find %s" % cmd)
- def query_nameservers(fqdn, ns=None):
- return [line[0] for line in run_query(cmd_path, "NS", fqdn, ns)]
-
- # Get a registry nameserver.
- reg_ns = random.choice(query_nameservers(".".join(fqdn.split(".")[1:])))
-
- nss = query_nameservers(fqdn, reg_ns)
- random.shuffle(nss)
-
+ nss = [line[0] for line in run_query(cmd_path, "NS", fqdn)]
current_serial = None
for ns in nss:
try: