Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dnsviz/dnsviz.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasey Deccio <casey@deccio.net>2019-03-07 21:23:26 +0300
committerCasey Deccio <casey@deccio.net>2019-03-07 21:23:26 +0300
commit5cdbd10c3f1ad79d7074ce6a13c843820fb750bc (patch)
treec9b6eb76d8d33495ad4f50ecdaee4bca294abdea
parent890887dc28b8efe1dbfa465908c5ec967caf55d5 (diff)
Convert int to text for presentation
-rw-r--r--dnsviz/analysis/errors.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/dnsviz/analysis/errors.py b/dnsviz/analysis/errors.py
index 720b698..3ba1a26 100644
--- a/dnsviz/analysis/errors.py
+++ b/dnsviz/analysis/errors.py
@@ -1286,15 +1286,19 @@ class EDNSUndefinedFlagsSet(EDNSError):
'''
>>> e = EDNSUndefinedFlagsSet(flags=0x80)
>>> e.description
- 'The server set EDNS flags that are undefined: 128.'
+ 'The server set EDNS flags that are undefined: 0x80.'
'''
_abstract = False
code = 'EDNS_UNDEFINED_FLAGS_SET'
- description_template = 'The server set EDNS flags that are undefined: %(flags)d.'
+ description_template = 'The server set EDNS flags that are undefined: %(flags_text)s.'
references = ['RFC 6891, Sec. 6.1.4']
required_params = ['flags']
+ def __init__(self, **kwargs):
+ super(EDNSUndefinedFlagsSet, self).__init__(**kwargs)
+ self.template_kwargs['flags_text'] = '0x%x' % (self.template_kwargs['flags'])
+
class DNSCookieError(ResponseError):
pass