mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parse yaml using cparser if present
This commit is contained in:
parent
1e867b0b8e
commit
825654a2fa
1 changed files with 6 additions and 1 deletions
|
@ -70,6 +70,11 @@ try:
|
|||
except ImportError:
|
||||
import json
|
||||
|
||||
try:
|
||||
from yaml import CSafeLoader as Loader
|
||||
except ImportError:
|
||||
from yaml import SafeLoader as Loader
|
||||
|
||||
PASSLIB_AVAILABLE = False
|
||||
try:
|
||||
import passlib.hash
|
||||
|
@ -594,7 +599,7 @@ def parse_yaml(data, path_hint=None):
|
|||
raise errors.AnsibleError(str(ve))
|
||||
else:
|
||||
# else this is pretty sure to be a YAML document
|
||||
loaded = yaml.safe_load(data)
|
||||
loaded = yaml.load(data, Loader=Loader)
|
||||
|
||||
return loaded
|
||||
|
||||
|
|
Loading…
Reference in a new issue