Skip to content

Commit

Permalink
check version on yaml aliases kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
akerl committed Jul 7, 2023
1 parent c44d425 commit 851dc15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/puppet-syntax/hiera.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def check(filelist)

filelist.each do |hiera_file|
begin
yamldata = YAML.load_file(hiera_file, aliases: true)
yamlargs = RUBY_VERSION >= '3.1' ? { aliases: true } : {}
yamldata = YAML.load_file(hiera_file, **yamlargs)
rescue Exception => error
errors << "ERROR: Failed to parse #{hiera_file}: #{error}"
next
Expand Down

0 comments on commit 851dc15

Please sign in to comment.