Add hotfixes

pull/38/head
Raphaël Vinot 2014-12-22 15:27:02 +01:00
parent 8803c8447a
commit 9ee61db2cf
2 changed files with 10 additions and 4 deletions

View File

@ -104,10 +104,14 @@ class Paste(object):
paste = self.cache.get(self.p_path) paste = self.cache.get(self.p_path)
if paste is None: if paste is None:
with gzip.open(self.p_path, 'rb') as f: try:
paste = f.read() with gzip.open(self.p_path, 'rb') as f:
self.cache.set(self.p_path, paste) paste = f.read()
self.cache.expire(self.p_path, 300) self.cache.set(self.p_path, paste)
self.cache.expire(self.p_path, 300)
except:
return ''
pass
return paste return paste
def get_p_content_as_file(self): def get_p_content_as_file(self):

View File

@ -34,6 +34,7 @@ def checking_MX_record(r_serv, adress_set):
# Transforming the set into a string # Transforming the set into a string
MXdomains = re.findall("@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,20}", str(adress_set).lower()) MXdomains = re.findall("@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,20}", str(adress_set).lower())
resolver = dns.resolver.Resolver() resolver = dns.resolver.Resolver()
resolver.nameservers = ['149.13.33.69']
resolver.timeout = 5 resolver.timeout = 5
resolver.lifetime = 2 resolver.lifetime = 2
if MXdomains != []: if MXdomains != []:
@ -86,6 +87,7 @@ def checking_A_record(r_serv, domains_set):
num = len(domains_set) num = len(domains_set)
WalidA = set([]) WalidA = set([])
resolver = dns.resolver.Resolver() resolver = dns.resolver.Resolver()
resolver.nameservers = ['149.13.33.69']
resolver.timeout = 5 resolver.timeout = 5
resolver.lifetime = 2 resolver.lifetime = 2