Commit 0d9df68e by Clinton Blackburn

Merge pull request #113 from edx/clintonb/mysql-warnings

Handling MySQL warnings as exceptions
parents eb64601c 7e6dfa93
import platform import platform
import sys import sys
import warnings
from logging.handlers import SysLogHandler from logging.handlers import SysLogHandler
from os import environ from os import environ
import certifi import certifi
import MySQLdb
import yaml import yaml
from course_discovery.settings.base import * from course_discovery.settings.base import *
...@@ -72,3 +74,7 @@ HAYSTACK_CONNECTIONS['default'].update({ ...@@ -72,3 +74,7 @@ HAYSTACK_CONNECTIONS['default'].update({
for override, value in DB_OVERRIDES.items(): for override, value in DB_OVERRIDES.items():
DATABASES['default'][override] = value DATABASES['default'][override] = value
# NOTE (CCB): Treat all MySQL warnings as exceptions. This is especially
# desired for truncation warnings, which hide potential data integrity issues.
warnings.filterwarnings('error', category=MySQLdb.Warning)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment