From: Alfredo Deza Date: Fri, 16 Feb 2018 15:10:05 +0000 (-0500) Subject: [RM-21677] hosts ensure that executable is a file X-Git-Tag: v2.0.1~8^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f11cdf4d6fb11fd84551c85c551577a8a55a65d5;p=ceph-deploy.git [RM-21677] hosts ensure that executable is a file Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py index fec1da0..7b32beb 100644 --- a/ceph_deploy/hosts/remotes.py +++ b/ceph_deploy/hosts/remotes.py @@ -339,7 +339,7 @@ def which(executable): for location in locations: executable_path = os.path.join(location, executable) - if os.path.exists(executable_path): + if os.path.exists(executable_path) and os.path.isfile(executable_path): return executable_path @@ -365,6 +365,7 @@ def safe_mkdir(path, uid=-1, gid=-1): else: os.chown(path, uid, gid) + def safe_makedirs(path, uid=-1, gid=-1): """ create path recursively if it doesn't exist """ try: