pyinfra.connectors.util module

pyinfra.connectors.util.execute_command_with_sudo_retry(host, command_kwargs, execute_command)
pyinfra.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, sudo_askpass_path=None, preserve_sudo_env=False, doas=False, doas_user=None)

Builds a shell command with various kwargs.

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

Builds a windows command with various kwargs.

pyinfra.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.connectors.util.read_buffers_into_queue(stdout_buffer, stderr_buffer, timeout, print_output, print_prefix)
pyinfra.connectors.util.remove_any_sudo_askpass_file(host)
pyinfra.connectors.util.run_local_process(command, stdin=None, timeout=None, print_output=False, print_prefix=None)
pyinfra.connectors.util.split_combined_output(combined_output)
pyinfra.connectors.util.write_stdin(stdin, buffer)