Skip to content

Commit d8860c1

Browse files
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 <[email protected]>
1 parent 19378b1 commit d8860c1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/cephadm/cephadmlib/container_types.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,11 @@ def get_running_container_name(
487487
return None
488488

489489

490-
def extract_uid_gid(ctx, img='', file_path='/var/lib/ceph'):
491-
# type: (CephadmContext, str, Union[str, List[str]]) -> Tuple[int, int]
490+
def extract_uid_gid(
491+
ctx: CephadmContext,
492+
img: str = '',
493+
file_path: Union[str, List[str]] = '/var/lib/ceph',
494+
) -> Tuple[int, int]:
492495

493496
if not img:
494497
img = ctx.image
@@ -503,10 +506,7 @@ def extract_uid_gid(ctx, img='', file_path='/var/lib/ceph'):
503506
for fp in paths:
504507
try:
505508
out = CephContainer(
506-
ctx,
507-
image=img,
508-
entrypoint='stat',
509-
args=['-c', '%u %g', fp]
509+
ctx, image=img, entrypoint='stat', args=['-c', '%u %g', fp]
510510
).run(verbosity=CallVerbosity.QUIET_UNLESS_ERROR)
511511
uid, gid = out.split(' ')
512512
return int(uid), int(gid)

0 commit comments

Comments
 (0)