summaryrefslogtreecommitdiffstats
path: root/test/lib/ansible_test/_util/target/tools/yamlcheck.py
blob: dfd08e581ca320a7cafd060641793a520041aca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Show availability of PyYAML and libyaml support."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import json

try:
    import yaml
except ImportError:
    yaml = None

try:
    from yaml import CLoader
except ImportError:
    CLoader = None

print(json.dumps(dict(
    yaml=bool(yaml),
    cloader=bool(CLoader),
)))