Add hotfixes

This commit is contained in:
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)
if paste is None:
with gzip.open(self.p_path, 'rb') as f:
paste = f.read()
self.cache.set(self.p_path, paste)
self.cache.expire(self.p_path, 300)
try:
with gzip.open(self.p_path, 'rb') as f:
paste = f.read()
self.cache.set(self.p_path, paste)
self.cache.expire(self.p_path, 300)
except:
return ''
pass
return paste
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
MXdomains = re.findall("@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,20}", str(adress_set).lower())
resolver = dns.resolver.Resolver()
resolver.nameservers = ['149.13.33.69']
resolver.timeout = 5
resolver.lifetime = 2
if MXdomains != []:
@ -86,6 +87,7 @@ def checking_A_record(r_serv, domains_set):
num = len(domains_set)
WalidA = set([])
resolver = dns.resolver.Resolver()
resolver.nameservers = ['149.13.33.69']
resolver.timeout = 5
resolver.lifetime = 2