Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mharding-hpe committed Sep 26, 2024
1 parent 7f57ce6 commit b08c786
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/bos/server/controllers/v2/boot_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def validate_boot_sets(session_template: dict,
# Verify boot sets exist.
if 'boot_sets' not in session_template or not session_template['boot_sets']:
msg = f"Session template '{template_name}' must have one or more defined boot sets for " \
"the creation of a session. It has none."
"the creation of a session. It has none."
return BOOT_SET_ERROR, msg

hardware_specifier_fields = ('node_roles_groups', 'node_list', 'node_groups')
Expand All @@ -72,8 +72,8 @@ def validate_boot_sets(session_template: dict,
if not any(specified):
msg = f"Session template: '{template_name}' boot set: '{bs_name}' " \
f"must have at least one " \
f"hardware specifier field provided (%s); None were provided." \
% (', '.join(sorted(hardware_specifier_fields)))
f"hardware specifier field provided (%s); None were provided." \
% (', '.join(sorted(hardware_specifier_fields)))
LOGGER.error(msg)
return BOOT_SET_ERROR, msg
if operation in ['boot', 'reboot']:
Expand All @@ -82,7 +82,7 @@ def validate_boot_sets(session_template: dict,
image_metadata = BootImageMetaDataFactory(bs)()
except Exception as err:
msg = f"Session template: '{template_name}' boot set: '{bs_name}' " \
f"could not locate its boot artifacts. Error: " + exc_type_msg(err)
f"could not locate its boot artifacts. Error: " + exc_type_msg(err)
LOGGER.error(msg)
return BOOT_SET_ERROR, msg

Expand All @@ -96,7 +96,7 @@ def validate_boot_sets(session_template: dict,
_ = obj.object_header
except Exception as err:
msg = f"Session template: '{template_name}' boot set: '{bs_name}' " \
f"could not locate its {boot_artifact}. Error: " + exc_type_msg(err)
f"could not locate its {boot_artifact}. Error: " + exc_type_msg(err)
LOGGER.error(msg)
return BOOT_SET_ERROR, msg

Expand All @@ -114,12 +114,11 @@ def validate_boot_sets(session_template: dict,
_ = obj.object_header
except Exception as err:
msg = f"Session template: '{template_name}' boot set: '{bs_name}' " \
f"could not locate its {boot_artifact}. Warning: " + exc_type_msg(err)
f"could not locate its {boot_artifact}. Warning: " + exc_type_msg(err)
LOGGER.warn(msg)
warning_flag = True
warn_msg = warn_msg + msg
if warning_flag:
return BOOT_SET_WARNING, warn_msg

return BOOT_SET_SUCCESS, "Valid"

0 comments on commit b08c786

Please sign in to comment.