From f41e18ed68d139ded4c32da4546f519d6fa43de8 Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Thu, 16 Nov 2023 16:44:38 -0500 Subject: [PATCH] Use unsafe_load to load a test file with unpermitted classes Part of https://github.com/ManageIQ/manageiq/issues/22696 --- .../manageiq/providers/ovirt/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/ovirt/infra_manager/event_parser_spec.rb b/spec/models/manageiq/providers/ovirt/infra_manager/event_parser_spec.rb index eed7b7b5..7048be16 100644 --- a/spec/models/manageiq/providers/ovirt/infra_manager/event_parser_spec.rb +++ b/spec/models/manageiq/providers/ovirt/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/ovirt/infra_manager/refresher/ovirt_refresher_spec_common.rb b/spec/models/manageiq/providers/ovirt/infra_manager/refresher/ovirt_refresher_spec_common.rb index 79f71db5..5a144f48 100644 --- a/spec/models/manageiq/providers/ovirt/infra_manager/refresher/ovirt_refresher_spec_common.rb +++ b/spec/models/manageiq/providers/ovirt/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