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

CASMCMS-9143: When validating boot sets, check all boot sets for severe errors before returning only warnings #371

Merged
merged 1 commit into from
Sep 26, 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.10.26] - 2024-09-26
### Fixed
- When validating boot sets, check all boot sets for severe errors before returning only warnings

## [2.10.25] - 2024-08-25
### Dependencies
- Simplify how latest patch version of `liveness` is determined
Expand Down
9 changes: 5 additions & 4 deletions src/bos/server/controllers/v2/boot_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def validate_boot_sets(session_template: dict,
return BOOT_SET_ERROR, msg

hardware_specifier_fields = ('node_roles_groups', 'node_list', 'node_groups')
warning_flag = False
warn_msg = ""
for bs_name, bs in session_template['boot_sets'].items():
# Verify that the hardware is specified
specified = [bs.get(field, None)
Expand Down Expand Up @@ -100,8 +102,6 @@ def validate_boot_sets(session_template: dict,
LOGGER.error(msg)
return BOOT_SET_ERROR, msg

warning_flag = False
warn_msg = ""
for boot_artifact in ["initrd", "boot_parameters"]:
try:
artifact = getattr(image_metadata.boot_artifacts, boot_artifact)
Expand All @@ -118,7 +118,8 @@ def validate_boot_sets(session_template: dict,
LOGGER.warn(msg)
warning_flag = True
warn_msg = warn_msg + msg
if warning_flag:
return BOOT_SET_WARNING, warn_msg

if warning_flag:
return BOOT_SET_WARNING, warn_msg

return BOOT_SET_SUCCESS, "Valid"
Loading