mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 04:06:42 +00:00
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>
18 lines
607 B
Python
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,
|
|
)
|