def clean(self):
"""Clean the database of any existing Ravel components"""
# close existing connections
self.conn.close()
conn = None
try:
conn = psycopg2.connect(database="postgres",
user=self.user,
password=self.passwd)
conn.set_isolation_level(ISOLEVEL)
cursor = conn.cursor()
cursor.execute("drop database %s" % self.name)
except psycopg2.DatabaseError, e:
logger.warning("error cleaning database: %s", self.fmt_errmsg(e))
finally:
if conn:
conn.close()
评论列表
文章目录