for i in range(3):
try:
value = self._lookup_unsafe(name, cls, type, timeout = None)
- except (psycopg2.OperationalError, sqlalchemy.exceptions.SQLError):
+ except (psycopg2.OperationalError, sqlalchemy.exceptions.DBAPIError):
if i == 2:
raise
print "Reloading database"
if value:
ip = value.ip
else:
- value = invirt.database.Machine.query().filter_by(name=host).first()
+ value = invirt.database.Machine.query.filter_by(name=host).first()
if value:
ip = value.nics[0].ip
else:
# check if it's within a subdomain we're supposed to delegate to
# some other DNS server.
while (isinstance(deferredResult.result, failure.Failure)
- and name.find('.') != -1):
+ and '.' in name):
maybeDelegate = True
name = name[name.find('.') + 1 :]
deferredResult = authority.BindAuthority._lookup(self, name, cls,