diff options
author | Casey Deccio <casey@deccio.net> | 2015-08-24 22:51:35 +0300 |
---|---|---|
committer | Casey Deccio <casey@deccio.net> | 2015-08-24 22:51:35 +0300 |
commit | 0550b8a883001012aefc7fe9e29133a01a6dc0f4 (patch) | |
tree | 95a3c82b09353e7a65791b736e38c4f67161891e /bin | |
parent | 0069ee49295fca24d3fc936bffb794abe6846a24 (diff) |
indent properly
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/dnsviz | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -173,6 +173,7 @@ def textualize_status_output(names, show_color): in_neg_response = False soa_seen = False + prev_rdtype_str = '' for rdtype_str, status, rdata in responses: # consider the cases in which we might no longer be in a negative @@ -192,12 +193,17 @@ def textualize_status_output(names, show_color): params['status'] = STATUS_MAP[status] if in_neg_response: params['indent'] = ' ' + if rdtype_str.startswith('NSEC'): + params['indent'] += ' ' + elif rdtype_str == 'RRSIG': + if prev_rdtype_str.startswith('NSEC'): + params['indent'] += ' ' + else: + params['indent'] += ' ' else: params['indent'] = '' - if rdtype_str.startswith('NSEC'): - params['indent'] += ' ' - if rdtype_str == 'RRSIG': - params['indent'] += ' ' + if rdtype_str == 'RRSIG': + params['indent'] += ' ' if show_color: params['status_color'] = TERM_COLOR_MAP[status] s += response_prefix % params @@ -225,6 +231,7 @@ def textualize_status_output(names, show_color): if rdata[0][1] in ('NXDOMAIN', 'NODATA'): in_neg_response = True soa_seen = False + prev_rdtype_str = rdtype_str return s |