From ef47f29e5e332aff0b2d26d88fb957eafbfa9e1a Mon Sep 17 00:00:00 2001 From: Dina Belova Date: Fri, 13 Nov 2015 13:45:15 +0300 Subject: [PATCH] Do not use api-paste.ini osprofiler options Starting with opsrofiler 0.3.1 release there is no need to set HMAC_KEYS and ENABLED arguments in the api-paste.ini file, this can be set in the trove.conf configuration file. Change-Id: Icbeb8bb09536bad88907fe590fa70386199ce03d --- etc/trove/api-paste.ini | 2 -- trove/common/cfg.py | 4 +++- trove/common/profile.py | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/etc/trove/api-paste.ini b/etc/trove/api-paste.ini index acaf1a691b..ea3612b937 100644 --- a/etc/trove/api-paste.ini +++ b/etc/trove/api-paste.ini @@ -34,8 +34,6 @@ paste.filter_factory = trove.common.limits:RateLimitingMiddleware.factory [filter:osprofiler] paste.filter_factory = osprofiler.web:WsgiMiddleware.factory -hmac_keys = SECRET_KEY -enabled = yes [app:troveapp] paste.app_factory = trove.common.api:app_factory diff --git a/trove/common/cfg.py b/trove/common/cfg.py index 523749ade6..0cd139e978 100644 --- a/trove/common/cfg.py +++ b/trove/common/cfg.py @@ -404,7 +404,9 @@ profiler_opts = [ cfg.BoolOpt("enabled", default=False, help="If False fully disable profiling feature."), cfg.BoolOpt("trace_sqlalchemy", default=True, - help="If False doesn't trace SQL requests.") + help="If False doesn't trace SQL requests."), + cfg.StrOpt("hmac_keys", default="SECRET_KEY", + help="Secret key to use to sign tracing messages."), ] diff --git a/trove/common/profile.py b/trove/common/profile.py index 975340a6f2..d59cf8483e 100644 --- a/trove/common/profile.py +++ b/trove/common/profile.py @@ -35,8 +35,9 @@ def setup_profiler(binary, host): "Messaging", messaging, context.get_admin_context().to_dict(), rpc.TRANSPORT, "trove", binary, host) notifier.set(_notifier) + web.enable(CONF.profiler.hmac_keys) LOG.warn(_LW("The OpenStack Profiler is enabled. Using one of the " - "hmac_keys specified in the api-paste.ini file " + "hmac_keys specified in the trove.conf file " "(typically in /etc/trove), a trace can be made of all " "requests. Only an admin user can retrieve the trace " "information, however.\n"