Skip to content

Commit

Permalink
Merge pull request #865 from jrafanie/psych4_support
Browse files Browse the repository at this point in the history
Psych 4 support
  • Loading branch information
agrare authored Nov 17, 2023
2 parents 1e16e6a + 4edca26 commit 7f75ccc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions 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
5 changes: 5 additions & 0 deletions app/models/manageiq/providers/openstack/helper_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ def parse_error_message_excon_http_status(exception)
end

def with_notification(type, options: {})
# We're explicitly serializing objects in the options subject key so we should permit yaml loading those classes
if options[:subject]
ActiveRecord::Base.yaml_column_permitted_classes = ActiveRecord::Base.yaml_column_permitted_classes | [options[:subject].class]
end

# extract success and error options from options
# :success and :error keys respectively
# with all other keys common for both cases
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
@flavor = FactoryBot.create(:flavor_openstack)
@volume = FactoryBot.create(:cloud_volume_openstack)

# We're storing objects in the instance_type, so we must permit loading this class
ActiveRecord::Base.yaml_column_permitted_classes = ActiveRecord::Base.yaml_column_permitted_classes | [@flavor.class]
@task = FactoryBot.create(:miq_provision_openstack,
:source => @template,
:state => 'pending',
Expand Down

0 comments on commit 7f75ccc

Please sign in to comment.