From fe5181923671163def26014ceb10939337b34692 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 24 Aug 2025 00:09:07 +0900 Subject: [PATCH] Fix GMR feature not actually enabled The argv can be None or [], so the if check is never evaluated as True. Change-Id: I1a6626b0139b5287a7385348678128acf2644163 Signed-off-by: Takashi Kajinami --- aodh/api/app.py | 2 +- aodh/service.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aodh/api/app.py b/aodh/api/app.py index c57b4bf69..f96555880 100644 --- a/aodh/api/app.py +++ b/aodh/api/app.py @@ -86,6 +86,6 @@ def app_factory(global_config, **local_conf): def build_wsgi_app(argv=None): - conf = service.prepare_service(argv=argv) + conf = service.prepare_service(argv=argv, with_gmr=False) conf.log_opt_values(LOG, log.DEBUG) return load_app(conf) diff --git a/aodh/service.py b/aodh/service.py index ab808e756..8a5e6e5d3 100644 --- a/aodh/service.py +++ b/aodh/service.py @@ -74,7 +74,7 @@ LISTENER_OPTS = [ ] -def prepare_service(argv=None, config_files=None): +def prepare_service(argv=None, config_files=None, with_gmr=True): conf = cfg.ConfigOpts() oslo_i18n.enable_lazy() log.register_options(conf) @@ -108,9 +108,9 @@ def prepare_service(argv=None, config_files=None): ka_loading.load_auth_from_conf_options(conf, "service_credentials") log.setup(conf, 'aodh') - # NOTE(tkajinam): guru cannot run with service under apache daemon, so when - # aod-api running with mod_wsgi, the argv is [], we don't start guru. - if argv: + # NOTE(tkajinam): disable GMR when app is run by mod_wsgi/uwsgi because + # signal handler can't be installed. + if with_gmr: gmr_opts.set_defaults(conf) gmr.TextGuruMeditation.setup_autorun(version, conf=conf)