Skip to content

Commit

Permalink
- apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcocenza committed May 6, 2024
1 parent 4180711 commit 2e9d313
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion cou/apps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,9 @@ def _get_upgrade_charm_step(self, target: OpenStackRelease) -> UpgradeStep:
logger.debug("%s channel already set to %s", self.name, self.channel)
return UpgradeStep()

# Normally, prior the upgrade the channel is equal to the application release.
# However, when colocated with other app, the channel can be in a release lesser than the
# workload version of the application.
if self.channel_o7k_release <= self.o7k_release:
return UpgradeStep(
description=f"Upgrade '{self.name}' from '{channel}' to the new channel: "
Expand All @@ -663,7 +666,7 @@ def _get_upgrade_charm_step(self, target: OpenStackRelease) -> UpgradeStep:

raise ApplicationError(
f"The '{self.name}' application is using channel '{self.channel}'. Channels supported "
f"this transition: '{self.expected_current_channel(target)}', "
f"during this transition: '{self.expected_current_channel(target)}', "
f"'{self.target_channel(target)}'. Manual intervention is required."
)

Expand Down
5 changes: 3 additions & 2 deletions tests/unit/apps/test_auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -1475,8 +1475,9 @@ def test_auxiliary_wrong_channel(model):
# or pacific. The user will need manual intervention

exp_msg = (
r"^The 'ceph-mon' application is using channel 'quincy/stable'\. Channels supported this "
r"transition: '(octopus/stable)', '(octopus/stable)'\. Manual intervention is required\.$"
r"^The 'ceph-mon' application is using channel 'quincy/stable'\. Channels supported during"
r" this transition: '(octopus/stable)', '(octopus/stable)'\. "
r"Manual intervention is required\.$"
)

with pytest.raises(ApplicationError, match=exp_msg):
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/apps/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,8 +1075,9 @@ def test_core_wrong_channel(model):
# or victoria. The user will need manual intervention

exp_msg = (
r"^The 'keystone' application is using channel 'wallaby/stable'\. Channels supported this "
r"transition: '(ussuri/stable)', '(victoria/stable)'\. Manual intervention is required\.$"
r"^The 'keystone' application is using channel 'wallaby/stable'\. Channels supported "
r"during this transition: '(ussuri/stable)', '(victoria/stable)'\. "
r"Manual intervention is required\.$"
)

with pytest.raises(ApplicationError, match=exp_msg):
Expand Down

0 comments on commit 2e9d313

Please sign in to comment.