fix flake8 failures
parent
2c32c03ab4
commit
e6a1724251
|
@ -32,6 +32,7 @@ class DynamicResolver(server.BaseResolver):
|
||||||
reply = request.reply()
|
reply = request.reply()
|
||||||
qname = request.q.qname
|
qname = request.q.qname
|
||||||
qtype = dnslib.QTYPE[request.q.qtype]
|
qtype = dnslib.QTYPE[request.q.qtype]
|
||||||
|
A_RECORDS = ['A', 'AAAA']
|
||||||
for name, rtype, rr in self.zone:
|
for name, rtype, rr in self.zone:
|
||||||
# Check if label & type match
|
# Check if label & type match
|
||||||
if qname == name and (qtype in [rtype, 'ANY'] or rtype == 'CNAME'):
|
if qname == name and (qtype in [rtype, 'ANY'] or rtype == 'CNAME'):
|
||||||
|
@ -40,7 +41,7 @@ class DynamicResolver(server.BaseResolver):
|
||||||
# add in additional section
|
# add in additional section
|
||||||
if rtype in ['CNAME', 'NS', 'MX', 'PTR']:
|
if rtype in ['CNAME', 'NS', 'MX', 'PTR']:
|
||||||
for a_name, a_rtype, a_rr in self.zone:
|
for a_name, a_rtype, a_rr in self.zone:
|
||||||
if a_name == rr.rdata.label and a_rtype in ['A', 'AAAA']:
|
if a_name == rr.rdata.label and a_rtype in A_RECORDS:
|
||||||
reply.add_ar(a_rr)
|
reply.add_ar(a_rr)
|
||||||
if not reply.rr:
|
if not reply.rr:
|
||||||
reply.header.rcode = dnslib.RCODE.NXDOMAIN
|
reply.header.rcode = dnslib.RCODE.NXDOMAIN
|
||||||
|
|
|
@ -9,7 +9,7 @@ def scrub_auth(request):
|
||||||
xml = StringIO.StringIO(request.body)
|
xml = StringIO.StringIO(request.body)
|
||||||
tree = ET.parse(xml)
|
tree = ET.parse(xml)
|
||||||
root = tree.getroot()
|
root = tree.getroot()
|
||||||
auth_param = tree.findall('./params/param/value/string')[0]
|
auth_param = root.findall('./params/param/value/string')[0]
|
||||||
auth_param.text = 'someuser:sometoken'
|
auth_param.text = 'someuser:sometoken'
|
||||||
scrubbed = StringIO.StringIO()
|
scrubbed = StringIO.StringIO()
|
||||||
tree.write(scrubbed)
|
tree.write(scrubbed)
|
||||||
|
|
|
@ -8,7 +8,7 @@ IPY = mock.MagicMock()
|
||||||
IPY.embed = mock.MagicMock()
|
IPY.embed = mock.MagicMock()
|
||||||
|
|
||||||
IPY_MODULES = {
|
IPY_MODULES = {
|
||||||
'IPython': IPY,
|
'IPython': IPY,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue