From 154ece98667cee00e6e4e813699ff21e47bc397b Mon Sep 17 00:00:00 2001 From: ethanholen-hpe Date: Tue, 17 Dec 2024 09:31:56 -0700 Subject: [PATCH] CRAYSAT-1942: Drop internal default values for rootfs_provider{,passthrough} from sat bootprep --- CHANGELOG.md | 6 +++ sat/apiclient/bos.py | 13 ------ sat/cli/bootprep/input/session_template.py | 2 +- tests/apiclient/test_bos.py | 50 +--------------------- 4 files changed, 8 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcb80a8d..448e35a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.33.9] - 2024-12-11 + +### Removed +- Removed internal default values for rootfs_provider{,passthrough} + from sat bootprep + ## [3.33.8] - 2024-12-18 ### Fixed diff --git a/sat/apiclient/bos.py b/sat/apiclient/bos.py index 0aa0143b..998ce7cb 100644 --- a/sat/apiclient/bos.py +++ b/sat/apiclient/bos.py @@ -132,19 +132,6 @@ def get_bos_client(session, version=None, **kwargs): return bos_client_cls(session, **kwargs) - @staticmethod - def get_base_boot_set_data(): - """Get the base boot set data to use as a starting point. - - Returns: - dict: the base data to use as a starting point for a boot set - """ - return { - 'rootfs_provider': 'cpss3', - # TODO (CRAYSAT-898): update default hostname for authoritative DNS changes - 'rootfs_provider_passthrough': 'dvs:api-gw-service-nmn.local:300:nmn0' - } - def get_session(self, session_id): """Get information about a given session. diff --git a/sat/cli/bootprep/input/session_template.py b/sat/cli/bootprep/input/session_template.py index b9e41e73..5dc990e1 100644 --- a/sat/cli/bootprep/input/session_template.py +++ b/sat/cli/bootprep/input/session_template.py @@ -188,7 +188,7 @@ def get_create_item_data(self): for boot_set_name, boot_set_data in self.boot_sets.items(): # Must deepcopy to avoid every boot set sharing the same dict - boot_set_api_data = deepcopy(self.bos_client.get_base_boot_set_data()) + boot_set_api_data = {} try: image_record = self.image_record except InputItemValidateError as err: diff --git a/tests/apiclient/test_bos.py b/tests/apiclient/test_bos.py index 576361ab..f2b59bd0 100644 --- a/tests/apiclient/test_bos.py +++ b/tests/apiclient/test_bos.py @@ -1,7 +1,7 @@ # # MIT License # -# (C) Copyright 2019-2022 Hewlett Packard Enterprise Development LP +# (C) Copyright 2019-2022, 2024 Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -84,51 +84,3 @@ def test_get_bos_client_version_kwarg_is_none(self): BOSClientCommon.get_bos_client(MagicMock(), version=None), client_cls ) - - -class TestBOSV1BaseBootSetData(BOSClientTestCase): - """Test BOSV1Client.get_base_boot_set_data() """ - - def setUp(self): - super().setUp() - self.mock_get_config.return_value = 'v1' - - def test_bos_v1_client_has_correct_keys(self): - """Test that the BOS v1 base boot set data has the correct keys""" - expected_keys = { - 'rootfs_provider', - 'rootfs_provider_passthrough' - } - actual_keys = set( - BOSClientCommon.get_bos_client(MagicMock()) - .get_base_boot_set_data() - .keys() - ) - self.assertTrue(expected_keys.issubset(actual_keys)) - - -class TestBOSV2BaseBootSetData(BOSClientTestCase): - """Test BOSV2Client.get_base_boot_set_data() """ - - def setUp(self): - super().setUp() - self.mock_get_config.return_value = 'v2' - - def test_bos_v2_client_has_correct_keys(self): - """Test that the BOS v2 base boot set data has the correct keys""" - expected_keys = { - 'rootfs_provider', - 'rootfs_provider_passthrough' - } - removed_keys = { - 'boot_ordinal', - 'network', - } - actual_keys = set( - BOSClientCommon.get_bos_client(MagicMock()) - .get_base_boot_set_data() - .keys() - ) - - self.assertTrue(expected_keys.issubset(actual_keys)) - self.assertTrue(removed_keys.isdisjoint(actual_keys))