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)
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()
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: