File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
app/models/manageiq/providers/openstack
spec/models/manageiq/providers/openstack/cloud_manager/provision Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ def self.display_name(number = 1)
105105
106106 def parse
107107 return JSON . parse ( content ) if format == 'json'
108- YAML . safe_load ( content , [ Date ] )
108+ YAML . safe_load ( content , :permitted_classes => [ Date ] )
109109 end
110110
111111 def validate_format_yaml
Original file line number Diff line number Diff line change @@ -64,6 +64,11 @@ def parse_error_message_excon_http_status(exception)
6464 end
6565
6666 def with_notification ( type , options : { } )
67+ # We're explicitly serializing objects in the options subject key so we should permit yaml loading those classes
68+ if options [ :subject ]
69+ ActiveRecord ::Base . yaml_column_permitted_classes = ActiveRecord ::Base . yaml_column_permitted_classes | [ options [ :subject ] . class ]
70+ end
71+
6772 # extract success and error options from options
6873 # :success and :error keys respectively
6974 # with all other keys common for both cases
Original file line number Diff line number Diff line change 55 @flavor = FactoryBot . create ( :flavor_openstack )
66 @volume = FactoryBot . create ( :cloud_volume_openstack )
77
8+ # We're storing objects in the instance_type, so we must permit loading this class
9+ ActiveRecord ::Base . yaml_column_permitted_classes = ActiveRecord ::Base . yaml_column_permitted_classes | [ @flavor . class ]
810 @task = FactoryBot . create ( :miq_provision_openstack ,
911 :source => @template ,
1012 :state => 'pending' ,
You can’t perform that action at this time.
0 commit comments