(conn, ident)
| 81 | |
| 82 | |
| 83 | def _mssql_drop_ignore(conn, ident): |
| 84 | try: |
| 85 | # typically when this happens, we can't KILL the session anyway, |
| 86 | # so let the cleanup process drop the DBs |
| 87 | # for row in conn.exec_driver_sql( |
| 88 | # "select session_id from sys.dm_exec_sessions " |
| 89 | # "where database_id=db_id('%s')" % ident): |
| 90 | # log.info("killing SQL server session %s", row['session_id']) |
| 91 | # conn.exec_driver_sql("kill %s" % row['session_id']) |
| 92 | conn.exec_driver_sql("drop database %s" % ident) |
| 93 | log.info("Reaped db: %s", ident) |
| 94 | return True |
| 95 | except exc.DatabaseError as err: |
| 96 | log.warning("couldn't drop db: %s", err) |
| 97 | return False |
| 98 | |
| 99 | |
| 100 | @run_reap_dbs.for_db("mssql") |
no test coverage detected