Skip to content

Commit

Permalink
small changes to make sanity checks more readble
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcocenza committed Jan 18, 2024
1 parent a0cac77 commit d861643
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cou/steps/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@ def is_supported_series(analysis_result: Analysis) -> None:
:raises OutOfSupportRange: When series is not supported.
"""
supporting_lts_series = ", ".join(LTS_TO_OS_RELEASE)
# series already checked at is_valid_openstack_cloud
if (
current_series := analysis_result.current_cloud_series
) and current_series not in LTS_TO_OS_RELEASE:
current_series = analysis_result.current_cloud_series
if current_series not in LTS_TO_OS_RELEASE:
raise OutOfSupportRange(
f"Cloud series '{current_series}' is not a Ubuntu LTS series supported by COU. "
f"The supporting series are: {supporting_lts_series}"
Expand All @@ -116,10 +114,12 @@ def is_highest_release_achieved(analysis_result: Analysis) -> None:
:type analysis_result: Analysis
:raises HighestReleaseAchieved: When the OpenStack release is the last supported by the series.
"""
current_os_release = analysis_result.current_cloud_os_release
current_series = analysis_result.current_cloud_series
if (
(current_os_release := analysis_result.current_cloud_os_release)
and (current_series := analysis_result.current_cloud_series)
and str(current_os_release) == LTS_TO_OS_RELEASE[current_series][-1]
current_series
and current_series
and str(current_os_release) == LTS_TO_OS_RELEASE.get(current_series, [])[-1]
):
raise HighestReleaseAchieved(
f"No upgrades available for OpenStack {str(current_os_release).capitalize()} on "
Expand Down

0 comments on commit d861643

Please sign in to comment.