Skip to content

Commit

Permalink
fix enable_action_managed naming
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcocenza committed Feb 6, 2024
1 parent e473db5 commit 92c2d88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 3 additions & 6 deletions cou/apps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,14 +624,12 @@ def _get_disable_action_managed_plan(self, parallel: bool = False) -> UpgradeSte
)
return UpgradeStep()

def _get_enable_action_managed_plan(self, parallel: bool = False) -> UpgradeStep:
"""Get plan to enable action-managed-upgrade.
def _get_enable_action_managed_step(self) -> UpgradeStep:
"""Get step to enable action-managed-upgrade.
This is used to upgrade as "paused-single-unit" strategy.
:param parallel: Parallel running, defaults to False
:type parallel: bool, optional
:return: Plan to enable action-managed-upgrade
:return: Step to enable action-managed-upgrade
:rtype: UpgradeStep
"""
if self.config.get("action-managed-upgrade", {}).get("value", False):
Expand All @@ -640,7 +638,6 @@ def _get_enable_action_managed_plan(self, parallel: bool = False) -> UpgradeStep
description=(
f"Change charm config of '{self.name}' 'action-managed-upgrade' to True."
),
parallel=parallel,
coro=self.model.set_application_config(self.name, {"action-managed-upgrade": True}),
)

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/apps/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_application_get_latest_os_version_failed(
"charm_config",
[{"action-managed-upgrade": {"value": False}}, {"action-managed-upgrade": {"value": True}}],
)
def test_get_enable_action_managed_plan(charm_config, model):
def test_get_enable_action_managed_step(charm_config, model):
charm = "app"
app_name = "my_app"
status = MagicMock(spec_set=ApplicationStatus())
Expand All @@ -65,7 +65,7 @@ def test_get_enable_action_managed_plan(charm_config, model):

app = OpenStackApplication(app_name, status, charm_config, model, charm, {})

assert app._get_enable_action_managed_plan() == expected_upgrade_step
assert app._get_enable_action_managed_step() == expected_upgrade_step


def test_get_pause_unit_step(model):
Expand All @@ -85,7 +85,7 @@ def test_get_pause_unit_step(model):
assert app._get_pause_unit_step(unit) == expected_upgrade_step


def test__get_resume_unit_step(model):
def test_get_resume_unit_step(model):
charm = "app"
app_name = "my_app"
status = MagicMock(spec_set=ApplicationStatus())
Expand Down

0 comments on commit 92c2d88

Please sign in to comment.