Updating the version for precise migration.
[invirt/packages/invirt-dns.git] / invirt-dns
index de53e0d..c320e51 100755 (executable)
@@ -45,7 +45,7 @@ class DatabaseAuthority(common.ResolverBase):
         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"
@@ -127,7 +127,7 @@ class DatabaseAuthority(common.ResolverBase):
             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:
@@ -202,7 +202,7 @@ class DelegatingQuotingBindAuthority(authority.BindAuthority):
         # 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,