From: Kefu Chai Date: Sat, 4 Aug 2018 12:52:29 +0000 (+0800) Subject: tools/cephfs: fix mkdirs(exist_ok) call X-Git-Tag: v14.0.1~617^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=16e795c05077fa6ed3e4fcb5642b32b1b42fc404;p=ceph.git 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 --- diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 96a5b0a667fb..06abf0b7574a 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