From d2cf9055b1b23d1007224e7982fb8433a232e62c Mon Sep 17 00:00:00 2001 From: Gabriel Cocenza Date: Mon, 5 Feb 2024 16:52:03 -0300 Subject: [PATCH] - fix remaining re-wording --- cou/apps/auxiliary.py | 4 ++-- cou/apps/base.py | 24 ++++++++++++------------ cou/apps/channel_based.py | 3 ++- cou/apps/subordinate.py | 3 +-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cou/apps/auxiliary.py b/cou/apps/auxiliary.py index b2b2a661..8c0f9290 100644 --- a/cou/apps/auxiliary.py +++ b/cou/apps/auxiliary.py @@ -150,12 +150,12 @@ def pre_upgrade_steps(self, target: OpenStackRelease) -> list[PreUpgradeStep]: return super().pre_upgrade_steps(target) + [self._get_change_require_osd_release_step()] def _get_change_require_osd_release_step(self) -> PreUpgradeStep: - """Get the ste to set correct value for require-osd-release option on ceph-mon. + """Get the step to set correct value for require-osd-release option on ceph-mon. This step is needed as a workaround for LP#1929254. Reference: https://docs.openstack.org/charm-guide/latest/project/issues/upgrade-issues.html#ceph-require-osd-release - :return: Plan to check and set correct value for require-osd-release + :return: Step to check and set correct value for require-osd-release :rtype: PreUpgradeStep """ ceph_mon_unit, *_ = self.units diff --git a/cou/apps/base.py b/cou/apps/base.py index 71527367..43f6773f 100644 --- a/cou/apps/base.py +++ b/cou/apps/base.py @@ -446,7 +446,7 @@ def pre_upgrade_steps(self, target: OpenStackRelease) -> list[PreUpgradeStep]: self._get_refresh_charm_step(target), ] - def upgrade_plan_steps(self, target: OpenStackRelease) -> list[UpgradeStep]: + def upgrade_steps(self, target: OpenStackRelease) -> list[UpgradeStep]: """Upgrade steps planning. :param target: OpenStack release as target to upgrade. @@ -497,7 +497,7 @@ def generate_upgrade_plan(self, target: OpenStackRelease) -> ApplicationUpgradeP ) all_steps = ( self.pre_upgrade_steps(target) - + self.upgrade_plan_steps(target) + + self.upgrade_steps(target) + self.post_upgrade_steps(target) ) for step in all_steps: @@ -506,9 +506,9 @@ def generate_upgrade_plan(self, target: OpenStackRelease) -> ApplicationUpgradeP return upgrade_steps def _get_upgrade_current_release_packages_step(self) -> PreUpgradeStep: - """Get Plan for upgrading software packages to the latest of the current release. + """Get step for upgrading software packages to the latest of the current release. - :return: Plan for upgrading software packages to the latest of the current release. + :return: Step for upgrading software packages to the latest of the current release. :rtype: PreUpgradeStep """ return PreUpgradeStep( @@ -519,14 +519,14 @@ def _get_upgrade_current_release_packages_step(self) -> PreUpgradeStep: ) def _get_refresh_charm_step(self, target: OpenStackRelease) -> PreUpgradeStep: - """Get plan for refreshing the current channel. + """Get step for refreshing the current channel. This function also identifies if charm comes from charmstore and in that case, makes the migration. :param target: OpenStack release as target to upgrade. :type target: OpenStackRelease :raises ApplicationError: When application has unexpected channel. - :return: Plan for refreshing the charm. + :return: Step for refreshing the charm. :rtype: PreUpgradeStep """ if not self.can_upgrade_current_channel: @@ -573,11 +573,11 @@ def _get_refresh_charm_step(self, target: OpenStackRelease) -> PreUpgradeStep: ) def _get_upgrade_charm_step(self, target: OpenStackRelease) -> UpgradeStep: - """Get plan for upgrading the charm. + """Get step for upgrading the charm. :param target: OpenStack release as target to upgrade. :type target: OpenStackRelease - :return: Plan for upgrading the charm. + :return: Step for upgrading the charm. :rtype: UpgradeStep """ if self.channel != self.target_channel(target): @@ -590,11 +590,11 @@ def _get_upgrade_charm_step(self, target: OpenStackRelease) -> UpgradeStep: return UpgradeStep() def _get_disable_action_managed_step(self) -> UpgradeStep: - """Get plan to disable action-managed-upgrade. + """Get step to disable action-managed-upgrade. This is used to upgrade as "all-in-one" strategy. - :return: Plan to disable action-managed-upgrade + :return: Step to disable action-managed-upgrade :rtype: UpgradeStep """ if self.config.get("action-managed-upgrade", {}).get("value", False): @@ -609,11 +609,11 @@ def _get_disable_action_managed_step(self) -> UpgradeStep: return UpgradeStep() def _get_workload_upgrade_step(self, target: OpenStackRelease) -> UpgradeStep: - """Get workload upgrade plan by changing openstack-origin or source. + """Get workload upgrade step by changing openstack-origin or source. :param target: OpenStack release as target to upgrade. :type target: OpenStackRelease - :return: Workload upgrade plan + :return: Workload upgrade step :rtype: UpgradeStep """ if self.os_origin != self.new_origin(target) and self.origin_setting: diff --git a/cou/apps/channel_based.py b/cou/apps/channel_based.py index 275b2587..0fa0b3b2 100644 --- a/cou/apps/channel_based.py +++ b/cou/apps/channel_based.py @@ -61,10 +61,11 @@ def is_versionless(self) -> bool: return not all(unit.workload_version for unit in self.status.units.values()) def post_upgrade_steps(self, target: OpenStackRelease) -> list[PostUpgradeStep]: - """Post Upgrade planning. + """Post Upgrade steps planning. Wait until the application reaches the idle state and then check the target workload. In case the application is versionless, there are no post upgrade steps to run. + :param target: OpenStack release as target to upgrade. :type target: OpenStackRelease :return: List of post upgrade steps. diff --git a/cou/apps/subordinate.py b/cou/apps/subordinate.py index 82bdecc4..b90b96a6 100644 --- a/cou/apps/subordinate.py +++ b/cou/apps/subordinate.py @@ -35,12 +35,11 @@ def pre_upgrade_steps(self, target: OpenStackRelease) -> list[PreUpgradeStep]: """ return [self._get_refresh_charm_step(target)] - def upgrade_plan_steps(self, target: OpenStackRelease) -> list[UpgradeStep]: + def upgrade_steps(self, target: OpenStackRelease) -> list[UpgradeStep]: """Upgrade steps planning. :param target: OpenStack release as target to upgrade. :type target: OpenStackRelease - :raises HaltUpgradePlanGeneration: When the application halt the upgrade plan generation. :return: List of upgrade steps. :rtype: list[UpgradeStep] """