mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-05 09:17:41 +03:00
B #-: Oncfg: make empty YAML load backward comp. (#3192)
This commit is contained in:
parent
f0ce1c110d
commit
112313cf4a
@ -43,6 +43,10 @@ module OneCfg::Config::Type
|
||||
|
||||
if Gem::Version.new(Psych.const_get(:VERSION)) >= Gem::Version.new('4.0')
|
||||
@content = YAML.load_file(name, :aliases => true)
|
||||
|
||||
# for backward compatibility with older Psych return `false`
|
||||
# instead of `nil` if the file was empty
|
||||
@content = false if @content.nil?
|
||||
else
|
||||
@content = YAML.load_file(name)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user