From: Tony Mack Date: Mon, 12 Mar 2012 16:39:03 +0000 (-0400) Subject: handle potential exception if db is not under version control X-Git-Tag: sfa-2.1-4~63 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=1e01b06d03b733d11254bef5445cf5aa884e6555;p=sfa.git handle potential exception if db is not under version control --- diff --git a/sfa/storage/dbschema.py b/sfa/storage/dbschema.py index 3776d527..4c99fb2b 100644 --- a/sfa/storage/dbschema.py +++ b/sfa/storage/dbschema.py @@ -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__':