blob: f308985b0b3fd374c5860c9c46526bb860b06936 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
"""Python wrapper around puppet strings."""
import subprocess
def puppet_strings(path: str) -> bytes:
"""Run `puppet strings` on puppet module at path."""
# TODO adding an --out flag (to not stdout) causes warnings to be
# printed to stdout. Warnings
cmd = subprocess.run('puppet strings generate --format json'.split(' '),
cwd=path,
check=True,
stdout=subprocess.PIPE)
return cmd.stdout
|