Skip to content

Allow tails-debugging-info commands to fail

This is the least invasive fix for #20200 (closed): make the command fail silently and report its stdout anyways (if any). I believe proper error reporting would require two new keys in the return value of debug_command, something like 'returncode' and 'stderr', but it makes no sense to add these for the moment if they aren't parsed and then reported.

Another interesting possibility is to merge the stdout and stderr and report that. This can be achieved via

    try:
        if shell:
            command_output = subprocess.check_output(' '.join(args), stderr=subprocess.STDOUT, shell=True)  # nosec any_other_function_with_shell_equals_true
        else:
            command_output = subprocess.check_output(args, stderr=subprocess.STDOUT)
    except subprocess.CalledProcessError as e:
        command_output = e.stdout
Edited by NoisyCoil

Merge request reports