From: John Mulligan Date: Wed, 16 Aug 2023 20:44:55 +0000 (-0400) Subject: cephadm: black format file_utils.py X-Git-Tag: v19.0.0~561^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1c6f2c9afa5aeea7dfceb82d0adb9d1fc7698844;p=ceph.git cephadm: black format file_utils.py Signed-off-by: John Mulligan Pair-programmed-with: Adam King Co-authored-by: Adam King Pair-programmed-with: Adam King Co-authored-by: Adam King --- diff --git a/src/cephadm/cephadmlib/file_utils.py b/src/cephadm/cephadmlib/file_utils.py index ff7304cc9246b..1ce4a6d399871 100644 --- a/src/cephadm/cephadmlib/file_utils.py +++ b/src/cephadm/cephadmlib/file_utils.py @@ -62,7 +62,9 @@ def populate_files(config_dir, config_files, uid, gid): f.write(config_content) -def touch(file_path: str, uid: Optional[int] = None, gid: Optional[int] = None) -> None: +def touch( + file_path: str, uid: Optional[int] = None, gid: Optional[int] = None +) -> None: Path(file_path).touch() if uid and gid: os.chown(file_path, uid, gid) @@ -70,8 +72,7 @@ def touch(file_path: str, uid: Optional[int] = None, gid: Optional[int] = None) def write_tmp(s, uid, gid): # type: (str, int, int) -> IO[str] - tmp_f = tempfile.NamedTemporaryFile(mode='w', - prefix='ceph-tmp') + tmp_f = tempfile.NamedTemporaryFile(mode='w', prefix='ceph-tmp') os.fchown(tmp_f.fileno(), uid, gid) tmp_f.write(s) tmp_f.flush() @@ -86,7 +87,7 @@ def makedirs(dir, uid, gid, mode): else: os.chmod(dir, mode) os.chown(dir, uid, gid) - os.chmod(dir, mode) # the above is masked by umask... + os.chmod(dir, mode) # the above is masked by umask... def recursive_chown(path: str, uid: int, gid: int) -> None: