From d8860c1336d2bf8c32d2105072ce153827452d74 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Thu, 19 Oct 2023 09:46:58 -0400 Subject: [PATCH] cephadm: update extract_uid_gid function annotations & format Update the type annotations of extract_uid_gid to the type annotations form used in more recent python versions. Reformat the function. Signed-off-by: John Mulligan --- src/cephadm/cephadmlib/container_types.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cephadm/cephadmlib/container_types.py b/src/cephadm/cephadmlib/container_types.py index 913a9cfe312..7ec323acf31 100644 --- a/src/cephadm/cephadmlib/container_types.py +++ b/src/cephadm/cephadmlib/container_types.py @@ -487,8 +487,11 @@ def get_running_container_name( return None -def extract_uid_gid(ctx, img='', file_path='/var/lib/ceph'): - # type: (CephadmContext, str, Union[str, List[str]]) -> Tuple[int, int] +def extract_uid_gid( + ctx: CephadmContext, + img: str = '', + file_path: Union[str, List[str]] = '/var/lib/ceph', +) -> Tuple[int, int]: if not img: img = ctx.image @@ -503,10 +506,7 @@ def extract_uid_gid(ctx, img='', file_path='/var/lib/ceph'): for fp in paths: try: out = CephContainer( - ctx, - image=img, - entrypoint='stat', - args=['-c', '%u %g', fp] + ctx, image=img, entrypoint='stat', args=['-c', '%u %g', fp] ).run(verbosity=CallVerbosity.QUIET_UNLESS_ERROR) uid, gid = out.split(' ') return int(uid), int(gid) -- 2.39.5