(*cmd, **kwargs)
return result
Convenience wrapper around oslo's execute() method.

    :param cmd: Passed to processutils.execute.
    :param use_standard_locale: True | False. Defaults to False. If set to
                                True, execute command with standard locale
                                added to environment variables.
    :returns: (stdout, stderr) from process execution
    :raises: UnknownArgumentError
    :raises: ProcessExecutionError
Convenience wrapper around oslo's execute() method.
Convenience wrapper around oslo s execute () method .
def execute(*cmd, **kwargs):
    """Convenience wrapper around oslo's execute() method.

    :param cmd: Passed to processutils.execute.
    :param use_standard_locale: True | False. Defaults to False. If set to
                                True, execute command with standard locale
                                added to environment variables.
    :returns: (stdout, stderr) from process execution
    :raises: UnknownArgumentError
    :raises: ProcessExecutionError
    """

    use_standard_locale = kwargs.pop('use_standard_locale', False)
    if use_standard_locale:
        env = kwargs.pop('env_variables', os.environ.copy())
        env['LC_ALL'] = 'C'
        kwargs['env_variables'] = env
    if kwargs.get('run_as_root') and 'root_helper' not in kwargs:
        kwargs['root_helper'] = _get_root_helper()
    result = processutils.execute(*cmd, **kwargs)
    LOG.debug('Execution completed, command line is "%s"',
              ' '.join(map(str, cmd)))
    LOG.debug('Command stdout is: "%s"', result[0])
    LOG.debug('Command stderr is: "%s"', result[1])
    return result
def execute ( * cmd , * * kwargs ) : use_standard_locale = kwargs . pop ( 'use_standard_locale' , False ) if use_standard_locale : env = kwargs . pop ( 'env_variables' , os . environ . copy ( ) ) env [ 'LC_ALL' ] = 'C' kwargs [ 'env_variables' ] = env if kwargs . get ( 'run_as_root' ) and 'root_helper' not in kwargs : kwargs [ 'root_helper' ] = _get_root_helper ( ) result = processutils . execute ( * cmd , * * kwargs ) LOG . debug ( 'Execution completed, command line is "%s"' , ' ' . join ( map ( str , cmd ) ) ) LOG . debug ( 'Command stdout is: "%s"' , result [ 0 ] ) LOG . debug ( 'Command stderr is: "%s"' , result [ 1 ] ) return result