summaryrefslogtreecommitdiffstats
path: root/test/lib/ansible_test/_util/controller/sanity/integration-aliases/yaml_to_json.py
blob: af11dd8a8be4a79e324879d90c7c78711894133b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
"""Read YAML from stdin and write JSON to stdout."""
from __future__ import annotations

import json
import sys

from yaml import load

try:
    from yaml import CSafeLoader as SafeLoader
except ImportError:
    from yaml import SafeLoader

json.dump(load(sys.stdin, Loader=SafeLoader), sys.stdout)