Skip to content

Commit 6405f75

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 1a2346e commit 6405f75

File tree

1 file changed

+10
-5
lines changed
  • src/cephadm/cephadmlib/daemons

1 file changed

+10
-5
lines changed

src/cephadm/cephadmlib/daemons/nfs.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ def for_daemon_type(cls, daemon_type: str) -> bool:
4242
return cls.daemon_type == daemon_type
4343

4444
def __init__(
45-
self, ctx, fsid, daemon_id, config_json, image=DEFAULT_IMAGE
46-
):
47-
# type: (CephadmContext, str, Union[int, str], Dict, str) -> None
45+
self,
46+
ctx: CephadmContext,
47+
fsid: str,
48+
daemon_id: Union[int, str],
49+
config_json: Dict,
50+
image: str = DEFAULT_IMAGE,
51+
) -> None:
4852
self.ctx = ctx
4953
self.fsid = fsid
5054
self.daemon_id = daemon_id
@@ -62,8 +66,9 @@ def __init__(
6266
self.validate()
6367

6468
@classmethod
65-
def init(cls, ctx, fsid, daemon_id):
66-
# type: (CephadmContext, str, Union[int, str]) -> NFSGanesha
69+
def init(
70+
cls, ctx: CephadmContext, fsid: str, daemon_id: Union[int, str]
71+
) -> 'NFSGanesha':
6772
return cls(ctx, fsid, daemon_id, fetch_configs(ctx), ctx.image)
6873

6974
@classmethod

0 commit comments

Comments
 (0)