This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new c637048 MicroDNS Extension: handle different 'default' types (#7159)
c637048 is described below
commit c63704852a093556cc461b9a123f8848d67296e2
Author: Brian Neradt <[email protected]>
AuthorDate: Thu Sep 3 18:19:51 2020 -0500
MicroDNS Extension: handle different 'default' types (#7159)
The MicroDNS extension supports populating the 'otherwise' node with a
list of hosts via the default parameter. The Traffic Server tests only
pass a string to default, but tests could also pass a list. This makes
the extension deal with either of these input types. As it is, without
this change, tests cannot pass a list because the list itself would be
wrapped as a list.
This change fixes the use of MicroDNS for plugins that use the
Traffic Server extensions, such as txn_box.so.
---
tests/gold_tests/autest-site/microDNS.test.ext | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/gold_tests/autest-site/microDNS.test.ext
b/tests/gold_tests/autest-site/microDNS.test.ext
index e508f5d..f33b095 100644
--- a/tests/gold_tests/autest-site/microDNS.test.ext
+++ b/tests/gold_tests/autest-site/microDNS.test.ext
@@ -82,7 +82,10 @@ def MakeDNServer(obj, name, filename="dns_file.json",
port=False, ip='INADDR_LOO
jsondata = {'mappings': []}
if default:
- jsondata['otherwise'] = [default]
+ if isinstance(default, str):
+ # MicroDNS expects 'otherwise' to be a sequence.
+ default = [default]
+ jsondata['otherwise'] = default
with open(filepath, 'w') as f:
f.write(json.dumps(jsondata))