Merge "Use libyaml parsing when available"
This commit is contained in:
commit
9641b719f9
@ -11,6 +11,10 @@ libffi6 [platform:dpkg !platform:ubuntu-focal !platform:ubuntu-jammy !platform:d
|
|||||||
libffi-devel [compile test platform:rpm]
|
libffi-devel [compile test platform:rpm]
|
||||||
libressl-dev [compile test platform:apk]
|
libressl-dev [compile test platform:apk]
|
||||||
libssl-dev [compile test platform:dpkg]
|
libssl-dev [compile test platform:dpkg]
|
||||||
|
libyaml-0-2 [platform:dpkg platform:suse]
|
||||||
|
libyaml [platform:redhat]
|
||||||
|
libyaml-dev [platform:dpkg compile test]
|
||||||
|
libyaml-devel [platform:rpm compile test]
|
||||||
linux-headers [compile test platform:apk]
|
linux-headers [compile test platform:apk]
|
||||||
make [compile test platform:apk platform:dpkg]
|
make [compile test platform:apk platform:dpkg]
|
||||||
musl-dev [compile test platform:apk]
|
musl-dev [compile test platform:apk]
|
||||||
|
@ -24,6 +24,11 @@ import yaml
|
|||||||
from nodepool.driver import ConfigValue
|
from nodepool.driver import ConfigValue
|
||||||
from nodepool.driver import Drivers
|
from nodepool.driver import Drivers
|
||||||
|
|
||||||
|
try:
|
||||||
|
from yaml import CSafeLoader as SafeLoader
|
||||||
|
except ImportError:
|
||||||
|
from yaml import SafeLoader
|
||||||
|
|
||||||
|
|
||||||
class ZooKeeperConnectionConfig(object):
|
class ZooKeeperConnectionConfig(object):
|
||||||
'''
|
'''
|
||||||
@ -407,7 +412,8 @@ def openConfig(path, env):
|
|||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
with open(path) as f:
|
with open(path) as f:
|
||||||
return yaml.safe_load(substitute_env_vars(f.read(), env))
|
return yaml.load(
|
||||||
|
substitute_env_vars(f.read(), env), SafeLoader)
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
if e.errno == 2:
|
if e.errno == 2:
|
||||||
retry = retry - 1
|
retry = retry - 1
|
||||||
|
Loading…
Reference in New Issue
Block a user