mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-03 05:03:43 +08:00
Squash 'Cannot find qpid python module' warnings from Moksha
Importing moksha causes a 'Cannot find qpid python module' warning if it's not installed, but we don't need the QPid support.
This commit is contained in:
@@ -26,6 +26,8 @@ from flask import Flask, has_app_context, url_for
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from sqlalchemy.pool import StaticPool
|
||||
|
||||
# Filter out warnings we don't want from external modules
|
||||
import module_build_service.log_workaround # noqa: F401
|
||||
from module_build_service.common.config import config_section
|
||||
from module_build_service.web.proxy import ReverseProxy
|
||||
|
||||
|
||||
9
module_build_service/log_workaround.py
Normal file
9
module_build_service/log_workaround.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import logging
|
||||
|
||||
|
||||
class QpidWarningFilter(logging.Filter):
|
||||
def filter(self, record):
|
||||
return "Cannot find qpid python module" not in record.getMessage()
|
||||
|
||||
|
||||
logging.getLogger("moksha.hub").addFilter(QpidWarningFilter())
|
||||
Reference in New Issue
Block a user