Skip to content

Commit

Permalink
We explicitly serialize objects so we need to permit yaml loading them
Browse files Browse the repository at this point in the history
  • Loading branch information
jrafanie committed Nov 15, 2023
1 parent 029a151 commit 4edca26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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 4edca26

Please sign in to comment.