Skip to content

Commit

Permalink
Merge pull request #372 from Cray-HPE/casmcms-9143-csm-1.4
Browse files Browse the repository at this point in the history
CASMCMS-9143: When validating boot sets, check all boot sets for severe errors before returning only warnings
  • Loading branch information
mharding-hpe authored Sep 26, 2024
2 parents e30ed3c + 1d209e1 commit 9758dcd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
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.0.46] - 2024-09-26
### Fixed
- When validating boot sets, check all boot sets for severe errors before returning only warnings

## [2.0.45] - 08-25-2024
### 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"

0 comments on commit 9758dcd

Please sign in to comment.