Skip to content

Commit

Permalink
remove _check_application_target from subordinate class
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcocenza committed May 7, 2024
1 parent f76a1d4 commit c18acc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
3 changes: 2 additions & 1 deletion cou/apps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,9 +836,10 @@ def _check_application_target(self, target: OpenStackRelease) -> None:
:raises HaltUpgradePlanGeneration: When the application halt the upgrade plan generation.
"""
logger.debug(
"%s application current os_release is %s and apt source is %s",
"%s current os_release is '%s' with origin setting '%s' and apt source '%s'",
self.name,
self.current_os_release,
self.os_origin,
self.apt_source_codename,
)

Expand Down
19 changes: 0 additions & 19 deletions cou/apps/subordinate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

from cou.apps.base import OpenStackApplication
from cou.apps.factory import AppFactory
from cou.exceptions import HaltUpgradePlanGeneration
from cou.steps import PostUpgradeStep, PreUpgradeStep, UpgradeStep
from cou.utils.juju_utils import Unit
from cou.utils.openstack import SUBORDINATES, OpenStackRelease
Expand All @@ -44,24 +43,6 @@ def current_os_release(self) -> OpenStackRelease:
"""
return self.channel_codename

def _check_application_target(self, target: OpenStackRelease) -> None:
"""Check if the application is already upgraded.
Subordinate applications use the apt source of the related principal and don't have an
origin/openstack-origin config option.
:param target: OpenStack release as target to upgrade.
:type target: OpenStackRelease
:raises HaltUpgradePlanGeneration: When the application halt the upgrade plan generation.
"""
logger.debug("%s application current os_release is %s", self.name, self.current_os_release)

if self.current_os_release >= target and not self.can_upgrade_to:
raise HaltUpgradePlanGeneration(
f"Application '{self.name}' already configured for release equal to or greater "
f"than {target}. Ignoring."
)

def _get_upgrade_current_release_packages_step(
self, units: Optional[list[Unit]]
) -> PreUpgradeStep:
Expand Down

0 comments on commit c18acc3

Please sign in to comment.