Merge "Simplify composition of processutils.execute kwarg"

This commit is contained in:
Zuul 2022-06-28 16:04:35 +00:00 committed by Gerrit Code Review
commit 8bc19b7171
1 changed files with 1 additions and 2 deletions

View File

@ -109,8 +109,7 @@ def _get_root_helper():
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()
kwargs.setdefault('root_helper', _get_root_helper())
if getattr(CONF, 'debug', False):
kwargs['loglevel'] = logging.DEBUG
return processutils.execute(*cmd, **kwargs)