pyinfra.api.connectors.util module

pyinfra.api.connectors.util.execute_command_with_sudo_retry(host, command_kwargs, execute_command)
pyinfra.api.connectors.util.get_sudo_askpass_exe()
pyinfra.api.connectors.util.make_unix_command(command, env=None, chdir=None, shell_executable='sh', su_user=None, use_su_login=False, su_shell=None, preserve_su_env=False, sudo=False, sudo_user=None, use_sudo_login=False, sudo_password=False, preserve_sudo_env=False, doas=False, doas_user=None)

Builds a shell command with various kwargs.

pyinfra.api.connectors.util.make_unix_command_for_host(state, host, *command_args, **command_kwargs)
pyinfra.api.connectors.util.make_win_command(command)

Builds a windows command with various kwargs.

pyinfra.api.connectors.util.read_buffer(type_, io, output_queue, print_output=False, print_func=None)

Reads a file-like buffer object into lines and optionally prints the output.

pyinfra.api.connectors.util.read_buffers_into_queue(stdout_buffer, stderr_buffer, timeout, print_output, print_prefix)
pyinfra.api.connectors.util.remove_any_sudo_askpass_file(host)
pyinfra.api.connectors.util.run_local_process(command, stdin=None, timeout=None, print_output=False, print_prefix=None)
pyinfra.api.connectors.util.split_combined_output(combined_output)
pyinfra.api.connectors.util.write_stdin(stdin, buffer)