Files
computer-playbook/utils/ansible_log.py
T
kevinveenbirkenbachandClaude Opus 5 3dee332350 fix(docs): let docutils read these docstrings and two markdown files
Three shapes of the same failure, taken from the build's own message list
rather than from a reading pass.

Eight unescaped inline characters in prose: a '*', '**', backtick or '|'
opens markup that never closes. 'roles/*/vars/main.yml', the regex
'^(web-|svc-).*', 'scripts/system/tls/trust/*.sh'. In ansible_log an inline
literal ended on a space, which reStructuredText forbids; the space carried
meaning, so it moved into the prose.

Thirteen example blocks after a single ':', which makes the indented block
a block quote instead of a literal one.

Three bullet lists with no blank line to the paragraph above, which
docutils reads as a continuation of that paragraph.

Two markdown files carried a '---' where reStructuredText allows no
transition: directly after a heading, and at the end of a document.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-25 19:24:19 +02:00

18 lines
607 B
Python

"""SPOT for the line prefix Ansible writes into its ``log_path`` file.
Every line of the file named by ``ANSIBLE_LOG_PATH`` carries
``<ts> p=<pid> u=<user> n=<name> <LEVEL>|`` and a space in front of the message that
also went to stdout. Left unstripped, that prefix defeats every
line-anchored matcher a reader applies, so a reader that mixes an anchored
match with an unanchored one silently sees an empty log instead of failing.
"""
from __future__ import annotations
import re
LOG_PREFIX_RE = re.compile(
r"^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d,\d+ p=\d+ u=\S+ n=\S+ (?:\w+)?\| ",
re.MULTILINE,
)