Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue found by new version of mypy #290

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cou/utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@
from typing import NoReturn

from cou.exceptions import InterruptError
from cou.steps import UpgradeStep
from cou.steps import UpgradePlan
from cou.utils import progress_indicator

logger = logging.getLogger(__name__)


async def _cancel_plan(plan: UpgradeStep, exit_code: int) -> NoReturn:
async def _cancel_plan(plan: UpgradePlan, exit_code: int) -> NoReturn:
"""Watch plan and raise InterruptError when it is done.

This watcher will make sure that InterruptError is raised after plan and all it's
sub-steps are done.

:param plan: watched UpgradeStep
:type plan: UpgradeStep
:type plan: UpgradePlan
:param exit_code: Exit code
:type exit_code: int
:raise InterruptError: raise InterruptError after plan and all it's sub-steps are done
Expand All @@ -51,13 +51,13 @@ async def _cancel_plan(plan: UpgradeStep, exit_code: int) -> NoReturn:
raise InterruptError("charmed-openstack-upgrader has been stopped safely", exit_code)


def interrupt_handler(plan: UpgradeStep, loop: asyncio.AbstractEventLoop, exit_code: int) -> None:
def interrupt_handler(plan: UpgradePlan, loop: asyncio.AbstractEventLoop, exit_code: int) -> None:
"""Handle cou interruption.

This handler first tries to safely cancel the update plan otherwise immediately raises
the exception.
:param plan: UpgradeStep to by canceled by this function
:type plan: UpgradeStep
:param plan: UpgradePlan to by canceled by this function
:type plan: UpgradePlan
:param loop: event loop
:type loop: asyncio.AbstractEventLoop
:param exit_code: Exit code
Expand Down
Loading