Skip to content

Commit d9acf69

Browse files
cephadm: update some type annotations
Update some function typing from the old comment based style to the current type annotations style. Not only does this modernize the code but it fixes issues found by newer versions of flake8 that were flagging types only referenced in type comments as unused imports. Part of an effort to get ceph tox environments passing on Python 3.12. Signed-off-by: John Mulligan <[email protected]>
1 parent 213d0b1 commit d9acf69

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cephadm/cephadmlib/systemd.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
logger = logging.getLogger()
1212

1313

14-
def check_unit(ctx, unit_name):
15-
# type: (CephadmContext, str) -> Tuple[bool, str, bool]
14+
def check_unit(ctx: CephadmContext, unit_name: str) -> Tuple[bool, str, bool]:
1615
# NOTE: we ignore the exit code here because systemctl outputs
1716
# various exit codes based on the state of the service, but the
1817
# string result is more explicit (and sufficient).
@@ -56,8 +55,9 @@ def check_unit(ctx, unit_name):
5655
return (enabled, state, installed)
5756

5857

59-
def check_units(ctx, units, enabler=None):
60-
# type: (CephadmContext, List[str], Optional[Packager]) -> bool
58+
def check_units(
59+
ctx: CephadmContext, units: List[str], enabler: Optional[Packager] = None
60+
) -> bool:
6161
for u in units:
6262
(enabled, state, installed) = check_unit(ctx, u)
6363
if enabled and state == 'running':

0 commit comments

Comments
 (0)