From 35d47c46fbd8401c4c9fc829c93f1938b601b052 Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Thu, 16 Nov 2023 16:32:08 -0500 Subject: [PATCH] Use unsafe_load to load a test file with unpermitted classes Part of https://github.com/ManageIQ/manageiq/issues/22696 --- .../providers/redhat/infra_manager/event_parser_spec.rb | 2 +- .../infra_manager/refresher/ovirt_refresher_spec_common.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/manageiq/providers/redhat/infra_manager/event_parser_spec.rb b/spec/models/manageiq/providers/redhat/infra_manager/event_parser_spec.rb index 76f2f3b..53121bd 100644 --- a/spec/models/manageiq/providers/redhat/infra_manager/event_parser_spec.rb +++ b/spec/models/manageiq/providers/redhat/infra_manager/event_parser_spec.rb @@ -20,7 +20,7 @@ require 'yaml' def load_response_mock_for(filename) prefix = described_class.name.underscore - YAML.load_file(File.join('spec', 'models', prefix, 'response_yamls', filename + '.yml')) + YAML.unsafe_load(File.read(File.join('spec', 'models', prefix, 'response_yamls', filename + '.yml'))) end before(:each) do diff --git a/spec/models/manageiq/providers/redhat/infra_manager/refresher/ovirt_refresher_spec_common.rb b/spec/models/manageiq/providers/redhat/infra_manager/refresher/ovirt_refresher_spec_common.rb index 24426cb..e9f680a 100644 --- a/spec/models/manageiq/providers/redhat/infra_manager/refresher/ovirt_refresher_spec_common.rb +++ b/spec/models/manageiq/providers/redhat/infra_manager/refresher/ovirt_refresher_spec_common.rb @@ -50,6 +50,6 @@ def init_inventory_wrapper_class def load_response_mock_for(filename) prefix = described_class.name.underscore - YAML.load_file(File.join('spec', 'models', prefix, 'response_yamls', filename + '.yml')) + YAML.unsafe_load(File.read(File.join('spec', 'models', prefix, 'response_yamls', filename + '.yml'))) end end