From a82b2ffce5ad11b591130df40500b2fb1673a129 Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Thu, 26 Jan 2023 15:41:15 +0100 Subject: [PATCH] Support separate privsep logging levels Currently we don't have os_brick DEBUG log levels in Nova when setting the service to debug mode. That happens because Nova is forcefully setting oslo.privsep.daemon levels to INFO to prevent leaking instance XML details (bug #1784062). Oslo Privsep now supports per-context debug log levels, so this patch sets the log level name for its only os_brick privsep context to "os_brick.privileged" to differentiate it from the service it runs under which uses the default "oslo_privsep.daemon". This way even though Nova is still disabling its own privileged calls it won't affect os-brick privileged calls, allowing us to properly debug block device attach/detach operations. Closes-Bug: #1922052 Related-Bug: #1784062 Change-Id: I0de32021eb90ca045845a6c7c7e3d27e52895948 --- os_brick/privileged/__init__.py | 1 + releasenotes/notes/privsep-logs-9e938e5a2aee042e.yaml | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 releasenotes/notes/privsep-logs-9e938e5a2aee042e.yaml diff --git a/os_brick/privileged/__init__.py b/os_brick/privileged/__init__.py index c41ff533c..4fc348c75 100644 --- a/os_brick/privileged/__init__.py +++ b/os_brick/privileged/__init__.py @@ -31,4 +31,5 @@ default = priv_context.PrivContext( cfg_section='privsep_osbrick', pypath=__name__ + '.default', capabilities=capabilities, + logger_name=__name__, ) diff --git a/releasenotes/notes/privsep-logs-9e938e5a2aee042e.yaml b/releasenotes/notes/privsep-logs-9e938e5a2aee042e.yaml new file mode 100644 index 000000000..be94d3f5a --- /dev/null +++ b/releasenotes/notes/privsep-logs-9e938e5a2aee042e.yaml @@ -0,0 +1,11 @@ +--- +features: + - | + Support separate privsep logging levels. Now services using os-brick can + have different log levels for the service and os-brick's privsep calls. + The service usually uses the default "oslo_privsep.daemon" name while + os-brick now uses "os_brick.privileged". +fixes: + - | + `Bug #1922052 `_: Fixed + missing os-brick DEBUG logs on nova compute service.