handle potential exception if db is not under version control
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Mon, 12 Mar 2012 16:39:03 +0000 (12:39 -0400)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Mon, 12 Mar 2012 16:39:03 +0000 (12:39 -0400)
sfa/storage/dbschema.py

index 3776d52..4c99fb2 100644 (file)
@@ -120,7 +120,10 @@ class DBSchema:
     def nuke (self):
         model.drop_tables(self.engine)
         # so in this case it's like we haven't initialized the db at all
-        migrate.drop_version_control (self.url, self.repository)
+        try:
+            migrate.drop_version_control (self.url, self.repository)
+        except migrate.exceptions.DatabaseNotControlledError:
+            logger.log_exc("Failed to drop version control")
         
 
 if __name__ == '__main__':