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:
parent
015c735b71
commit
650fb59cc5
@ -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)
|
||||
|
||||
|
@ -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}' " \
|
||||
|
Loading…
Reference in New Issue
Block a user