Skip to content

Commit

Permalink
Merge pull request #234 from agrare/fix_yaml_load_file_alias_errors
Browse files Browse the repository at this point in the history
Fix YAML.load_file failing on aliases
  • Loading branch information
jrafanie authored Feb 1, 2024
2 parents c30c3f3 + 485e72c commit ae5aed1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/manageiq/appliance_console/database_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,13 @@ def self.load_current
require 'fileutils'
FileUtils.cp(DB_YML_TMPL, DB_YML) if File.exist?(DB_YML_TMPL)
end
YAML.load_file(DB_YML)

data = File.read(DB_YML)
if YAML.respond_to?(:safe_load)
YAML.safe_load(data, :aliases => true)
else
YAML.load(data) # rubocop:disable Security/YAMLLoad
end
end

def validate_encryption_key!
Expand Down

0 comments on commit ae5aed1

Please sign in to comment.