Fix reference to the debug config option

... so that debug logs are enabled in some sub modules as intended.

Change-Id: If3b7eb60bdcaea13de6b65241605d1e31976b309
This commit is contained in:
Takashi Kajinami 2022-05-26 22:42:23 +09:00
parent 6852d562d9
commit 6b29d8d621
1 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ from manila.i18n import _
CONF = cfg.CONF
LOG = log.getLogger(__name__)
if hasattr('CONF', 'debug') and CONF.debug:
if getattr(CONF, 'debug', False):
logging.getLogger("paramiko").setLevel(logging.DEBUG)
_ISO8601_TIME_FORMAT_SUBSECOND = '%Y-%m-%dT%H:%M:%S.%f'
@ -95,7 +95,7 @@ def execute(*cmd, **kwargs):
"""Convenience wrapper around oslo's execute() function."""
if 'run_as_root' in kwargs and 'root_helper' not in kwargs:
kwargs['root_helper'] = _get_root_helper()
if hasattr('CONF', 'debug') and CONF.debug:
if getattr(CONF, 'debug', False):
kwargs['loglevel'] = logging.DEBUG
return processutils.execute(*cmd, **kwargs)