1
0
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:
Jan Orel 2024-08-04 22:04:04 +02:00 committed by GitHub
parent f0ce1c110d
commit 112313cf4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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