(self)
return ""
Check if executable exists and has execute permissions
Check if executable exists and has execute permissions
Check if executable exists and has execute permissions
def _check_executable(self):
        """Check if executable exists and has execute permissions"""
        if self.opt["entryp"] and is_genstr(self.opt["entryp"]):
            self.opt["entryp"] = self.opt["entryp"].strip().split(' ')
        if isinstance(self.opt["entryp"], list):
            if self.opt["cmd"]:                                     # and cmd
                cmd_args = self.opt["cmd"]
                self.opt["cmd"] = self.opt["entryp"]
                self.opt["cmd"].extend(cmd_args)   # cmd=args entryp
            else:
                self.opt["cmd"] = self.opt["entryp"]
        if not self.opt["cmd"]:
            self.opt["cmd"] = Config.conf['cmd']
            Msg().err("Warning: no command assuming:", self.opt["cmd"],
                      l=Msg.WAR)
        exec_name = self.opt["cmd"][0]            # exec pathname without args
        if exec_name.startswith("./") or exec_name.startswith("../"):
            exec_name = self.opt["cwd"] + '/' + exec_name

        path = self.opt["env"].getenv("PATH")
        # DEBUG
        exec_name = FileUtil(exec_name).find_exec(path, self.container_root,
                                                  self.opt["vol"],
                                                  self.opt["cwd"])
        if exec_name:
            return self.container_root + '/' + exec_name
        Msg().err("Error: command not found or has no execute bit set: ",
                  self.opt["cmd"])
        return ""
def _check_executable ( self ) : if self . opt [ "entryp" ] and is_genstr ( self . opt [ "entryp" ] ) : self . opt [ "entryp" ] = self . opt [ "entryp" ] . strip ( ) . split ( ' ' ) if isinstance ( self . opt [ "entryp" ] , list ) : if self . opt [ "cmd" ] : # and cmd cmd_args = self . opt [ "cmd" ] self . opt [ "cmd" ] = self . opt [ "entryp" ] self . opt [ "cmd" ] . extend ( cmd_args ) # cmd=args entryp else : self . opt [ "cmd" ] = self . opt [ "entryp" ] if not self . opt [ "cmd" ] : self . opt [ "cmd" ] = Config . conf [ 'cmd' ] Msg ( ) . err ( "Warning: no command assuming:" , self . opt [ "cmd" ] , l = Msg . WAR ) exec_name = self . opt [ "cmd" ] [ 0 ] # exec pathname without args if exec_name . startswith ( "./" ) or exec_name . startswith ( "../" ) : exec_name = self . opt [ "cwd" ] + '/' + exec_name path = self . opt [ "env" ] . getenv ( "PATH" ) # DEBUG exec_name = FileUtil ( exec_name ) . find_exec ( path , self . container_root , self . opt [ "vol" ] , self . opt [ "cwd" ] ) if exec_name : return self . container_root + '/' + exec_name Msg ( ) . err ( "Error: command not found or has no execute bit set: " , self . opt [ "cmd" ] ) return ""