]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: add a make_run_dir function
authorJohn Mulligan <jmulligan@redhat.com>
Sun, 5 Nov 2023 21:03:34 +0000 (16:03 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 30 Nov 2023 19:08:58 +0000 (14:08 -0500)
This function is roughly the same as make_var_run only it doesn't rely
on shelling out to the install command. Eventually, it will be used
to replace make_var_run in certain locations.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadmlib/file_utils.py

index 7c9e6f69e43415bb42f0837e6da40987afe7d61d..1b9f11499a49f4b0673d53c310820a9ebdb06f0b 100644 (file)
@@ -139,3 +139,7 @@ def get_file_timestamp(fn):
         ).strftime(DATEFMT)
     except Exception:
         return None
+
+
+def make_run_dir(fsid: str, uid: int, gid: int) -> None:
+    makedirs(f'/var/run/ceph/{fsid}', uid, gid, 0o770)