Exception handled for unknown origins

This commit is contained in:
Alexandre Dulaunoy 2014-08-20 10:51:55 +02:00
parent 94482dcfbf
commit d116cfc37b

View file

@ -146,12 +146,18 @@ class Extract:
for dom in self.validdomain: for dom in self.validdomain:
if dom[1] == 'A': if dom[1] == 'A':
ip = dom[2] ip = dom[2]
orig = self.__origin(ipaddr=dom[2])[1] try:
orig = self.__origin(ipaddr=dom[2])[1]
except:
continue
if(orig == cc): self.localdom.append(dom) if(orig == cc): self.localdom.append(dom)
elif dom[1] == 'CNAME': elif dom[1] == 'CNAME':
cname = str(dom[2]) cname = str(dom[2])
ip = socket.gethostbyname(cname) ip = socket.gethostbyname(cname)
orig = self.__origin(ipaddr=ip)[1] try:
orig = self.__origin(ipaddr=ip)[1]
except:
continue
if(orig == cc): self.localdom.append(dom) if(orig == cc): self.localdom.append(dom)
return self.localdom return self.localdom