From 16e795c05077fa6ed3e4fcb5642b32b1b42fc404 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 4 Aug 2018 20:52:29 +0800 Subject: [PATCH] tools/cephfs: fix mkdirs(exist_ok) call we need to use pathlib.Path.mkdirs(parents=True, exist_ok=True) or os.mkdirs(path), but not both. Signed-off-by: Kefu Chai --- src/tools/cephfs/cephfs-shell | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 96a5b0a667fb1..06abf0b7574a0 100644 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -220,8 +220,7 @@ def copy_from_local(shell, local_path, remote_path): def copy_to_local(shell, remote_path, local_path): local_dir = os.path.dirname(local_path) if not os.path.exists(local_dir): - os.makedirs(local_dir, exist_ok=True) - + os.makedirs(local_dir) fd = None if len(remote_path.rsplit('/', 1)) > 2 and remote_path.rsplit('/', 1)[1] == '': return -- 2.39.5