Opened 7 years ago

Closed 7 years ago

#5594 enhancement closed fixed (fixed)

Twisted Names example testdns.py presents results very poorly

Reported by: Jean-Paul Calderone Owned by: Thijs Triemstra
Priority: normal Milestone:
Component: names Keywords: examples documentation
Cc: Richard Wall, Thijs Triemstra Branch:
Author: rwall

Description

Some problems:

  1. Arbitrary 4 second timeout. If results don't arrive by then, the example silently exits (thanks, slow network, for pointing this out to me)
  2. When results do come back, they only the RRHeader instances are printed. This excludes actual address information, making it difficult or impossible to actually see the core part of the functionality these APIs are supposed to provide.

It would be great to:

  1. run until the queries all succeed or fail
  2. display the RRHeader data and the type-specific payload

Attachments (1)

testdns-output-5594.patch (2.7 KB) - added by Richard Wall 7 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by Richard Wall

Attachment: testdns-output-5594.patch added

comment:1 Changed 7 years ago by Richard Wall

Cc: Richard Wall added
Keywords: review added

Added a patched version of testdns.py with better output and which exits when all results are in.

Not sure whether a topfile is necessary for a documentation change?

comment:2 Changed 7 years ago by Thijs Triemstra

Author: rwall
Cc: Thijs Triemstra added
Keywords: review removed
Owner: set to Thijs Triemstra
Status: newassigned

Much better! python doc/names/examples/testdns.py nsa.gov:

Addresses:  [<RR name=nsa.gov type=A class=IN ttl=86362s auth=False>, <RR name=nsa.gov type=A class=IN ttl=86362s auth=False>, <RR name=nsa.gov type=A class=IN ttl=86362s auth=False>, <RR name=nsa.gov type=A class=IN ttl=86362s auth=False>], [], []
Nameservers:  [<RR name=nsa.gov type=NS class=IN ttl=28762s auth=False>, <RR name=nsa.gov type=NS class=IN ttl=28762s auth=False>], [], []
Mail Exchangers:  [<RR name=nsa.gov type=MX class=IN ttl=3600s auth=False>, <RR name=nsa.gov type=MX class=IN ttl=3600s auth=False>], [], []

vs.

# Addresses
nsa.gov IN <A address=12.120.172.8 ttl=86400>
nsa.gov IN <A address=12.120.166.8 ttl=86400>
nsa.gov IN <A address=12.120.186.8 ttl=86400>
nsa.gov IN <A address=12.120.184.8 ttl=86400>

# Mail Exchangers
nsa.gov IN <MX preference=20 name=emvm-gh1-uea08.nsa.gov ttl=3600>
nsa.gov IN <MX preference=20 name=emvm-gh1-uea09.nsa.gov ttl=3600>

# Nameservers
nsa.gov IN <NS name=dsdn-gh1-uea05.nsa.gov ttl=28800>
nsa.gov IN <NS name=dsdn-gh1-uea06.nsa.gov ttl=28800>

comment:3 Changed 7 years ago by Thijs Triemstra

Resolution: fixed
Status: assignedclosed

(In [35558]) Apply testdns-output-5594.patch.

Author: rwall Reviewer: thijs Fixes: #5594

Pretty print the output of the testdns example.

Note: See TracTickets for help on using tickets.