fix flake8 failures

master
Justin Riley 2016-08-03 11:45:57 -04:00
parent 2c32c03ab4
commit e6a1724251
3 changed files with 4 additions and 3 deletions

View File

@ -32,6 +32,7 @@ class DynamicResolver(server.BaseResolver):
reply = request.reply()
qname = request.q.qname
qtype = dnslib.QTYPE[request.q.qtype]
A_RECORDS = ['A', 'AAAA']
for name, rtype, rr in self.zone:
# Check if label & type match
if qname == name and (qtype in [rtype, 'ANY'] or rtype == 'CNAME'):
@ -40,7 +41,7 @@ class DynamicResolver(server.BaseResolver):
# add in additional section
if rtype in ['CNAME', 'NS', 'MX', 'PTR']:
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)
if not reply.rr:
reply.header.rcode = dnslib.RCODE.NXDOMAIN

View File

@ -9,7 +9,7 @@ def scrub_auth(request):
xml = StringIO.StringIO(request.body)
tree = ET.parse(xml)
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'
scrubbed = StringIO.StringIO()
tree.write(scrubbed)

View File

@ -8,7 +8,7 @@ IPY = mock.MagicMock()
IPY.embed = mock.MagicMock()
IPY_MODULES = {
'IPython': IPY,
'IPython': IPY,
}