parent
e6a7c0e30b
commit
f189106ef6
1 changed files with 8 additions and 2 deletions
|
@ -7,10 +7,16 @@ __metaclass__ = type
|
|||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
import yaml
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
from yaml import load as yaml_load
|
||||
try:
|
||||
# use C version if possible for speedup
|
||||
from yaml import CSafeLoader as SafeLoader
|
||||
except ImportError:
|
||||
from yaml import SafeLoader
|
||||
|
||||
from ansible.config.data import ConfigData
|
||||
from ansible.errors import AnsibleOptionsError, AnsibleError
|
||||
from ansible.module_utils.six import string_types
|
||||
|
@ -181,7 +187,7 @@ class ConfigManager(object):
|
|||
# consume definitions
|
||||
if os.path.exists(b_defs_file):
|
||||
with open(b_defs_file, 'rb') as config_def:
|
||||
self._base_defs = yaml.safe_load(config_def)
|
||||
self._base_defs = yaml_load(config_def, Loader=SafeLoader)
|
||||
else:
|
||||
raise AnsibleError("Missing base configuration definition file (bad install?): %s" % to_native(b_defs_file))
|
||||
|
||||
|
|
Loading…
Reference in a new issue