Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release/3.33] CRAYSAT-1942: Drop internal default values for rootfs_provider{,passthrough} from sat bootprep #309

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 0 additions & 13 deletions sat/apiclient/bos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion sat/cli/bootprep/input/session_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
50 changes: 1 addition & 49 deletions tests/apiclient/test_bos.py
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down Expand Up @@ -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))
Loading