1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-04 05:17:40 +03:00

B #-: Fix loading YAML with aliases (#3190)

This commit is contained in:
Jan Orel 2024-08-02 19:15:26 +02:00 committed by GitHub
parent 015c735b71
commit 650fb59cc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -165,7 +165,11 @@ module OneCfg::Patch
#
# @param filename [String] path to patch in YAML format
def parse_yaml(filename)
@patches = YAML.load_file(filename)
if Psych::VERSION > '4.0'
@patches = YAML.load_file(filename, :aliases => true)
else
@patches = YAML.load_file(filename)
end
return if @patches.is_a?(Hash)

View File

@ -42,7 +42,11 @@ module OneCfg
reset
if ::File.exist?(@name)
@content = YAML.load_file(@name)
if Psych::VERSION > '4.0'
@content = YAML.load_file(@name, :alises => true)
else
@content = YAML.load_file(@name)
end
end
rescue StandardError => e
OneCfg::LOG.error("Can't load settings from '#{@name}' " \