Skip to content

Commit

Permalink
Update safe_load calls to work with psych 3/4
Browse files Browse the repository at this point in the history
Part of ManageIQ/manageiq#22696

Keep compatibility with psych 3.1+ since permitted_classes and aliases were
added as keyword arguments to safe_load.

Note, psych 4 changed the interface to drop support with positional arguments for the permitted_classes.
Now, we must explicitly specify them using kwargs.
  • Loading branch information
jrafanie committed Nov 15, 2023
1 parent 1e16e6a commit 029a151
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def self.display_name(number = 1)

def parse
return JSON.parse(content) if format == 'json'
YAML.safe_load(content, [Date])
YAML.safe_load(content, :permitted_classes => [Date])
end

def validate_format_yaml
Expand Down

0 comments on commit 029a151

Please sign in to comment.