def getDockerExecutable(): """ Return the name of the docker executable or None if docker is not installed. """ if executablePath.which("docker.io"): # Docker is called docker.io on debian. return "docker.io" if executablePath.which("docker"): return "docker" return None
def getDockerExecutable(): """ Return the name of the docker executable. Exits and displays a user friendly error message if docker is not setup correctly. """ if executablePath.which("docker.io"): # Docker is called docker.io on debian. return "docker.io" if executablePath.which("docker"): return "docker" sys.exit( """Error: Docker is not installed. For instalation instructions see <https://www.docker.io/gettingstarted/#h_installation>""" ) if not os.path.exists("/var/run/docker.pid"): sys.exit( """Error: Docker is not running. You can launch it as root with: # docker -d """ ) username = getpass.getuser() if not username in grp.getgrnam("docker").gr_mem: sys.exit( """Error: You are not a member of the docker group. To learn how to become a member of the docker group please watch this video: <http://www.youtube.com/watch?v=ahgRx5U4V7E>""" )
def getSubuserCommandPath(command): builtInCommandPath = os.path.join(_getSubuserCommandsPath(),command) if os.path.exists(builtInCommandPath): return builtInCommandPath else: externalCommandPath = executablePath.which("subuser-"+command) return externalCommandPath
def getSubuserCommandPath(command): builtInCommandPath = os.path.join(paths.getSubuserCommandsDir(),command) if os.path.exists(builtInCommandPath): return builtInCommandPath else: externalCommandPath = executablePath.which("subuser-"+command) return externalCommandPath
def getSubuserCommandPath(command): builtInCommandPath = os.path.join(paths.getSubuserCommandsDir(),command) if os.path.exists(builtInCommandPath): return builtInCommandPath elif os.path.exists(builtInCommandPath+".py"): return (builtInCommandPath+".py") else: externalCommandPath = executablePath.which("subuser-"+command) return externalCommandPath
def getDockerExecutable(): """ Return the name of the docker executable. Exits and displays a user friendly error message if docker is not setup correctly. """ if executablePath.which( "docker.io"): # Docker is called docker.io on debian. return "docker.io" if executablePath.which("docker"): return "docker" sys.exit("""Error: Docker is not installed. For instalation instructions see <https://www.docker.io/gettingstarted/#h_installation>""" ) if not os.path.exists("/var/run/docker.pid"): sys.exit( """Error: Docker is not running. You can launch it as root with: # docker -d """) username = getpass.getuser() if not username in grp.getgrnam("docker").gr_mem: sys.exit("""Error: You are not a member of the docker group. To learn how to become a member of the docker group please watch this video: <http://www.youtube.com/watch?v=ahgRx5U4V7E>""" )