diff --git a/src/onecfg/lib/patch/apply.rb b/src/onecfg/lib/patch/apply.rb index a4f027faa4..5a53691064 100644 --- a/src/onecfg/lib/patch/apply.rb +++ b/src/onecfg/lib/patch/apply.rb @@ -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) diff --git a/src/onecfg/lib/settings.rb b/src/onecfg/lib/settings.rb index f713cb610e..45b321e697 100644 --- a/src/onecfg/lib/settings.rb +++ b/src/onecfg/lib/settings.rb @@ -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}' " \