From 51137bceb534a9329b35b613b6c48c2a65fc321d Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Tue, 31 Oct 2023 13:55:01 +0000 Subject: [PATCH] python3.8 fix --- src/snap.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/snap.py b/src/snap.py index fce74bcf..0fae301a 100644 --- a/src/snap.py +++ b/src/snap.py @@ -30,8 +30,9 @@ class _RefreshVerb(str, enum.Enum): def _refresh(*, unit: ops.Unit, verb: _RefreshVerb) -> None: - logger.debug(f'{verb.capitalize().removesuffix("e")}ing {_SNAP_NAME=}, {REVISION=}') - unit.status = ops.MaintenanceStatus(f'{verb.capitalize().removesuffix("e")}ing snap') + # TODO python3.10 min version: use `removesuffix` instead of `rstrip` + logger.debug(f'{verb.capitalize().rstrip("e")}ing {_SNAP_NAME=}, {REVISION=}') + unit.status = ops.MaintenanceStatus(f'{verb.capitalize().rstrip("e")}ing snap') def _set_retry_status(_) -> None: message = f"Snap {verb} failed. Retrying..." @@ -48,7 +49,7 @@ def _set_retry_status(_) -> None: with attempt: _snap.ensure(state=snap_lib.SnapState.Present, revision=REVISION) _snap.hold() - logger.debug(f'{verb.capitalize().removesuffix("e")}ed {_SNAP_NAME=}, {REVISION=}') + logger.debug(f'{verb.capitalize().rstrip("e")}ed {_SNAP_NAME=}, {REVISION=}') def install(*, unit: ops.Unit, model_uuid: str):