]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-21677] hosts ensure that executable is a file
authorAlfredo Deza <adeza@redhat.com>
Fri, 16 Feb 2018 15:10:05 +0000 (10:10 -0500)
committerAlfredo Deza <adeza@redhat.com>
Fri, 16 Feb 2018 15:10:05 +0000 (10:10 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph_deploy/hosts/remotes.py

index fec1da0d6031690396ef1ba43c4ea215dd6db6b9..7b32bebe12a0493306f01d787591ba07fed80816 100644 (file)
@@ -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: