From: Gary Kotton Date: Sat, 20 Oct 2012 01:41:29 +0000 (+0000) Subject: Fix database clear when table does not exist X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ded7f9354b2069dad65766fd24cc032a6631beb0;p=openstack-build%2Fneutron-build.git Fix database clear when table does not exist Problem occurs when running individual tests. Change-Id: I5223cf0d66aa5bffeb304dda19c784e31a54a7c0 --- diff --git a/quantum/db/api.py b/quantum/db/api.py index d2bc0bd21..a5f5cc99e 100644 --- a/quantum/db/api.py +++ b/quantum/db/api.py @@ -88,7 +88,10 @@ def clear_db(base=BASE): global _ENGINE assert _ENGINE for table in reversed(base.metadata.sorted_tables): - _ENGINE.execute(table.delete()) + try: + _ENGINE.execute(table.delete()) + except Exception as e: + LOG.info("Unable to delete table. %s.", e) def get_session(autocommit=True, expire_on_commit=False):